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

# TWinControl.CustomAlignInsertBefore

Indicates whether the specified controls were custom-aligned using the OnAlignInsertBefore handler.

## Declaration

Source position: controls.pp line 2159

`protected function TWinControl.CustomAlignInsertBefore(`
`AControl1: TControl;`
`AControl2: TControl`
`):Boolean; virtual;`

## Arguments

`AControl1` |  | Child control examined in the event handler for its aligment order.
`AControl2` |  | Child control examined in the event handler for its aligment order.

## Function result

True if Control2 should be placed before Control1.

## Description

CustomAlignInsertBefore is a Boolean function which indicates whether the specified controls need to be custom-aligned using the OnAlignInsertBefore handler. CustomAlignInsertBefore is called (circuitously) when auto-sizing is performed in the DoAutoSize method, and the Align property in the control is alCustom.

AControl1 and AControl2 are child controls examined to determine the alignment order in the parent control.

The return value is False if OnAlignInsertBefore has not been assigned in the control, or when the controls do not require custom alignment. True indicates that the controls are swapped in the alignment order.

## See also

TWinControl.OnAlignInsertBefore |  | Event handler signalled to determine the order and placement for custom-aligned child controls.
TWinControl.DoAutoSize |  | Shrinks or enlarges the control to accommodate its children.
TAlignInsertBeforeEvent |  | Type of an OnAlignInsertBefore handler.