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

# TWinControl.DoAutoSize

Shrinks or enlarges the control to accommodate its children.

## Declaration

Source position: controls.pp line 2179

`protected procedure TWinControl.DoAutoSize; override;`

## Description

Because this method is frequently overridden, the LCL calls the TControl.AdjustSize method instead; it checks whether DoAutoSize really should be called right now.

DoAutoSize performs the following:

- Checks whether Autosize is permitted
- Checks for unaligned child components and aligns them as best it can
- Moves the constrained (aligned) child components to the correct position
- Adjusts the size of the client rectangle
- Adjusts the bounds of the whole control

## See also

TControl.DoAutoSize |  | For internal use only; call AdjustSize instead.