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

# TWinControl.DoAllAutoSize

Performs actions to resize and align the control and all of its children.

## Declaration

Source position: controls.pp line 2180

`protected procedure TWinControl.DoAllAutoSize; override;`

## Description

DoAllAutoSize is an overridden method in TWinControl.

No actions are performed in the method when wcfAllAutoSizing has already been included in the window control flags; in other words, the method has already been called. No actions are performed when AutoSizeDelayed returns True.

DoAllAutoSize checks to ensure that a Handle has been allocated for the control, and that it and its Parent are Visible. If AutoSizing is not possible, the flag is removed from the control and its children and the method is exited.

DoAllAutoSize calls the inherited method to change the bounds, invalidate the preferred size, and update flags for the control. RealizeBoundsRecursive is called to update the bounds for the all child controls. The child controls are made visible first, and then the current control instance.

DoAllAutoSize is called from the AdjustSize and EnableAutoSizing methods.

## Errors

The inherited method raises an EInvalidOperation exception if Parent has not been assigned for the control.

Raises a catchable exception when cfAutoSizeNeeded is already included in the control flags when the method is called.

## See also

TControl.DoAllAutoSize |  | Resizes and aligns the control and all of it children.
TControl.Parent |  | The control within which the control is shown.
TControl.AutoSizingAll |  | Flag to prevent recursive AutoSizing (in DoAllAutoSize).