Delphi實(shí)例演示Rect、Bounds生成TRect的區(qū)別
本文以實(shí)例演示Rect、Bounds生成TRect的區(qū)別,實(shí)例代碼如下:
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); {參數(shù)3、4 是一個(gè)點(diǎn)} 2: Button1.BoundsRect := Bounds(50,50,100,80);{參數(shù)3、4 分別是寬度與高度} end; end; end.
最終實(shí)現(xiàn)效果圖如下:
上一篇:Delphi用TActionList實(shí)現(xiàn)下載文件的方法
欄 目:Delphi
下一篇:Delphi實(shí)現(xiàn)木馬文件傳輸代碼實(shí)例
本文標(biāo)題:Delphi實(shí)例演示Rect、Bounds生成TRect的區(qū)別
本文地址:http://mengdiqiu.com.cn/a1/Delphi/8629.html
您可能感興趣的文章
- 01-10在Delphi實(shí)現(xiàn)在數(shù)據(jù)庫中存取圖像的圖文演示無錯(cuò)
- 01-10delphi建立、讀取、存貯INI文件的方法《三》
- 01-10Delphi Command模式
- 01-10delphi 正弦曲線圖
- 01-10delphi建立、讀取、存貯INI文件的方法《二》
- 01-10插件管理框架 for Delphi(二)
- 01-10插件管理框架 for Delphi(一)
- 01-10Delphi中判斷文件是否為文本文件的函數(shù)
- 01-10delphi中一個(gè)值得大家來考慮的DLL問題
- 01-10初探Delphi中的插件編程


閱讀排行
本欄相關(guān)
- 01-10在Delphi實(shí)現(xiàn)在數(shù)據(jù)庫中存取圖像的圖
- 01-10delphi建立、讀取、存貯INI文件的方法
- 01-10delphi 正弦曲線圖
- 01-10Delphi Command模式
- 01-10delphi建立、讀取、存貯INI文件的方法
- 01-10插件管理框架 for Delphi(二)
- 01-10插件管理框架 for Delphi(一)
- 01-10Delphi中判斷文件是否為文本文件的函
- 01-10delphi中一個(gè)值得大家來考慮的DLL問題
- 01-10初探Delphi中的插件編程
隨機(jī)閱讀
- 01-11Mac OSX 打開原生自帶讀寫NTFS功能(圖文
- 01-10delphi制作wav文件的方法
- 04-02jquery與jsp,用jquery
- 01-10SublimeText編譯C開發(fā)環(huán)境設(shè)置
- 08-05dedecms(織夢(mèng))副欄目數(shù)量限制代碼修改
- 01-10使用C語言求解撲克牌的順子及n個(gè)骰子
- 01-10C#中split用法實(shí)例總結(jié)
- 08-05織夢(mèng)dedecms什么時(shí)候用欄目交叉功能?
- 08-05DEDE織夢(mèng)data目錄下的sessions文件夾有什
- 01-11ajax實(shí)現(xiàn)頁面的局部加載