Sign in Join
FPDoc Onlineexperiment

TWinControl.SetBounds procedure

Member of TWinControlpublicIn unit Controls

Sets the control bounds and adjusts child and docked controls.

Declaration

pascal
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; 
 AHeight: Integer); override

Arguments

ALeft

The X coordinate for the left side of the control.

ATop

The Y coordinate for the left side of the control.

AWidth

The width for the control.

AHeight

The height for the control.

Description

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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.