If you want to set the Bounds
, you need to do it with a rectangle. (Please forgive any syntax mistakes in my examples; my Delphi is a little rusty.)
BoundsRect: Rectangle;
BoundsRect.X = 10;
BoundsRect.Y = 10;
BoundsRect.Width := 100;
BoundsRect.Height := 103;
Panel1.Bounds := BoundsRect;
Typically, you'd use that if you want to set or change multiple properties. If you just want to set one or two properties, you can use Width
, Top
, etc.
One other difference is that every time you set one of those properties (either Bounds
, or one of the individual properties), it causes a lot of work behind the scenes (moving and redrawing the window, etc.). Setting the Bounds
property from the rectangle will be less work.