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

# TCustomControlBar.AlignControlToBand

Aligns the control for the specified band and updates its coordinates for use in subsequent resize operations.

## Declaration

Source position: extctrls.pp line 1612

`protected procedure TCustomControlBar.AlignControlToBand(`
`ABand: TCtrlBand;`
`ARightToLeft: Boolean`
`);`

## Arguments

`ABand` |  | TCtrlBand with the control positioned and aligned in the method.
`ARightToLeft` |  | True if right-to-left layout is used for the band decorations and control.

## Description

AlignControlToBand updates values in ABand to ensure that the Control for the band is centered vertically within its bounds and positioned for the setting in ARightToLeft. Values from the Control are stored in the ControlLeft, ControlTop, ControlHeight, and ControlWidth properties in the control band. This allows the values to be used in subsequent resize operations.

AlignControlToBand is called from the AlignControlsToBands and InitializeBand methods.

## See also

TCustomControlBar.AlignControlsToBands |  | Aligns visible control bands in the container.
TCustomControlBar.InitializeBand |  | Configures a control bar band and calculates its row position, order, and geometry including client decorations.
TCtrlBand.Control |  | Contains the control displayed on the band.
TCtrlBand.ControlLeft |  | Stored Left position for the Control used in comparisons during resizing.
TCtrlBand.ControlTop |  | Stored Top position for the Control used in comparisons during resizing.
TCtrlBand.ControlWidth |  | Stored Width for the Control used in comparisons during resizing.
TCtrlBand.ControlHeight |  | Stored Height for the Control used during resizing.