Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]


Sets the control bounds and adjusts child and docked controls.


Source position: controls.pp line 2318

public procedure TWinControl.SetBounds(

  ALeft: Integer;

  ATop: Integer;

  AWidth: Integer;

  AHeight: Integer

); override;




The X coordinate for the left side of the control.



The Y coordinate for the left side of the control.



The width for the control.



The height for the control.


SetBounds is an overridden method in TWinControl. used to set the bounds for the control to the values in the ALeft, ATop, AWidth, and AHeight arguments.

No actions are performed in the method when the internal BoundsLockCount member has a non-zero value. In other words, when BeginUpdateBounds has been called and EndUpdateBounds has not been called.

At design-time, SetBounds checks to ensure that negative is not present in the Width or Height properties when the user has changed the bounds for the control.

SetBounds calls DisableAutoSizing to reduce the overhead for recomputing/moving/resizing when the bounds are changed. The inherited method is called to apply the new values in ALeft, ATop, AWidth, and AHeight. EnableAutoSizing is called to re-enable auto-sizing when the operation has been completed.

SetBounds is called when any one of these Left, Top, Width or Height properties, or the BoundsRect property has been changed.

Keep in mind that the given aLeft, aTop, aWidth, aHeight might not be valid and will be changed by the LCL before applied.

See also



Starts an update to the Bounds property; disables SetBounds by incrementing BoundsLockCount.



Ends an update to the Bounds property; decrements BoundsLockCount and eventually calls SetBounds.



Sets the bounds (Left, Top, Width, Height) of the control.



Sets the bounds (left, top, height, width) and optionally the BaseBounds of the control.



Disables automatic sizing; implies that the default size is accepted, or sizing is done manually.



Enables automatic sizing for the control.

CT Web help

CodeTyphon Studio