RAD Studio VCL Reference
TWinControl.AdjustSize Method

Adjusts the control's size according to its contents and constraints.

procedure AdjustSize; override;
virtual __fastcall AdjustSize();

If the AutoSize property is true, AdjustSize is called automatically when the control needs to automatically resize itself to its contents. As implemented in TWinControl, AdjustSize calls SetBounds with the values of its Left, Top, Width, and Height properties. This call can result in a change of size if these values are altered in the control's OnCanResize or OnConstrainedResize event handlers, or if the control's OnResize event handler makes any final adjustments. 

Descendant classes override AdjustSize to change the size of the control to adjust to its contents. 

Component writers may call AdjustSize when making changes to a control's contents. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!