[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Controls' (#lcl)

TWinControl.DoSetBounds

Updates the size and extent of the control and ClientRect.

Declaration

Source position: controls.pp line 2023

protected procedure TWinControl.DoSetBounds(

  ALeft: Integer;

  ATop: Integer;

  AWidth: Integer;

  AHeight: Integer

); override;

Description

Changing the ClientRect here, to the most probable size, reduces unneccessary resizes.

Normally the clientwidth/clientheight is adjusted automatically by the widget, but it is up to widget when this will be done. The gtk for example just puts resize requests into a queue. The LCL would resize the child components just after this procedure due to the clientrect. On complex forms with lots of nested controls, this would result in thousands of resizes.

See also

#LCL.Controls.TControl.DoSetBounds

  

Internal function to set the control's bounds (Left, Top, Height, Width).

The latest version of this document can be found at lazarus-ccr.sourceforge.net.