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

# TControl.DoAutoAdjustLayout

Applies layout changes using the specified policy and scaling proportions to the control.

## Declaration

Source position: controls.pp line 1558

`protected procedure TControl.DoAutoAdjustLayout(`
`const AMode: TLayoutAdjustmentPolicy;`
`const AXProportion: Double;`
`const AYProportion: Double`
`); virtual;`

## Arguments

`AMode` |  | Identifies the auto-layout policy applied in the method.
`AXProportion` |  | Scaling factor for horizontal dimensions.
`AYProportion` |  | Scaling factor for vertical dimensions.

## Description

DoAutoAdjustLayout is a method which implements changes to control sizes for the AutoAdjustLayout method. These methods are called when High-DPI and scaling have been enabled in the project options for an application.

AMode indicates the automatic layout policy applied in the method. It is a value from the TLayoutAdjustmentPolicy enumeration, and determines whether horizontal / vertical / or both sizes are adjusted in the method. It generally reflects the constraints for the device type where the application is running.

AXProportion and AYProportion contain the scaling factors applied to the horizontal and/or vertical sizes.

DoAutoAdjustLayout ensures that new values for Height and Width in the control are calculated (when allowed and needed) using the scaling factors, Constraints, BorderSpacing and Anchors for the control. The SetBoundsKeepBase method is called to apply the newly calculated values to the control.

Font scaling is performed in AutoAdjustLayout (when needed) and occurs prior to calling DoAutoAdjustLayout.

DoAutoAdjustLayout, ScaleFontsPPI, and FixDesignFontsPPI are often overridden in descendent classes to perform additional actions needed for a control or its children.

## See also

TControl.AutoAdjustLayout |  | Applies an automatic adjustment layout policy to the control.
TControl.ShouldAutoAdjust |  | Indicates whether the height and/or width for a control can be automatically adjusted.
TControl.Anchors |  | The set of anchor definitions for this control.
TControl.BorderSpacing |  | Determines the inner and outer border spacing for this control.
TControl.Constraints |  | Contains the minimum and maximum Width and Height for the control.
TControl.SetBoundsKeepBase |  | Set the bounds, keeping the base values.