手机
当前位置:查字典教程网 >编程开发 >Delphi >Delphi实例演示Rect、Bounds生成TRect的区别
Delphi实例演示Rect、Bounds生成TRect的区别
摘要:本文以实例演示Rect、Bounds生成TRect的区别,实例代码如下:unitUnit1;interfaceusesWindows,Mes...

本文以实例演示Rect、Bounds生成TRect的区别,实例代码如下:

unitUnit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Button1: TButton; RadioGroup1: TRadioGroup; procedure RadioGroup1Click(Sender: TObject); procedure FormCreate(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} var R: TRect; procedure TForm1.FormCreate(Sender: TObject); begin RadioGroup1.Items.CommaText := 'Undo,Rect,Bounds'; R := Button1.BoundsRect; end; procedure TForm1.RadioGroup1Click(Sender: TObject); begin case RadioGroup1.ItemIndex of 0: Button1.BoundsRect := R; 1: Button1.BoundsRect := Rect(50,50,100,80); {参数3、4 是一个点} 2: Button1.BoundsRect := Bounds(50,50,100,80);{参数3、4 分别是宽度与高度} end; end; end.

最终实现效果图如下:

Delphi实例演示Rect、Bounds生成TRect的区别1

【Delphi实例演示Rect、Bounds生成TRect的区别】相关文章:

Delphi实现毫秒级别的倒计时实例代码

delphi发送消息控制滚动条使用示例

Delphi实现窗体感知鼠标滑过并自动隐藏与显示窗口的方法

delphi程序全屏显示无标题栏覆盖整个屏幕(适合屏保)

Delphi实现截屏存盘的方法

Delphi实现判断网址是否存在及是否可以打开的方法

Delphi实现检测并枚举系统安装的打印机的方法

delphi中一个值得大家来考虑的DLL问题

在Delphi实现在数据库中存取图像的图文演示无错

delphi中exit,abort,break,continue的区别介绍

精品推荐
分类导航