This article uses an example to demonstrate the difference between Rect and Bounds generating TRect. The example code is as follows:
unitUnit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls, ExtCtrls;typeTForm1 = class(TForm)Button1: TButton;RadioGroup1: TRadioGroup;procedure RadioGroup1Click(Sender: TObject);procedure FormCreate(Sender : TObject);end;varForm1: TForm1;implementation{$R *.dfm}varR: TRect;procedure TForm1.FormCreate(Sender: TObject);beginRadioGroup1.Items.CommaText := 'Undo,Rect,Bounds';R := Button1 .BoundsRect;end;procedure TForm1.RadioGroup1Click(Sender: TObject);begincase RadioGroup1.ItemIndex of0: Button1.BoundsRect := R;1: Button1.BoundsRect := Rect(50,50,100,80); {Parameters 3 and 4 are a point}2: Button1 .BoundsRect := Bounds(50,50,100,80);{Parameters 3 and 4 are width and height respectively}end;end;end.The final rendering is as follows: