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

# TCustomUpDown.OnAssociateChangeBounds

Implements an OnChangeBounds event handler assigned to the Associate control in the class instance.

## Declaration

Source position: comctrls.pp line 1973

`protected procedure TCustomUpDown.OnAssociateChangeBounds(`
`Sender: TObject`
`);`

## Arguments

`Sender` |  | Control for the event notification. Not used in the method.

## Description

OnAssociateChangeBounds ensures that the control is repositioned and realigned to the Associate control when its bounds have been changed.

The AlignButton property is used to determine which coordinates (Left, Right, Width, or Height) are adjusted to align and position the control adjacent to the Associate control.

udLeft, udRight
  Causes the Top and Height properties for the control to be set to the corresponding values in Associate. The Left property is calculated to place the up/down control relative to the specified edge for the Associate control.
upTop, udBottom
  Causes the Left and Width properties for the control to be set to the corresponding values in Associate. The Top property is calculated to place the up/down control relative to the specified edge for the Associate control.

SetBounds is called to apply the calculated Left, Top, Width, and Height values to the control.

No actions are performed in the method if a control has not been assigned to the Associate property in the class instance.

OnAssociateChangeBounds is assigned when a control is assigned to the Associate property.

## See also

TCustomUpDown.AlignButton |  | AlignButton - how to align the button: left or right.
TCustomUpDown.Associate |  | Control used to display and edit the Position for the control.
TUDAlignButton |  | Contains values used to align the buttons on a TUpDown control.
TWinControl.SetBounds |  | Sets the control bounds and adjusts child and docked controls.
TControl.Width |  | The horizontal size for the control.
TControl.Height |  | The vertical size for the control.
TControl.Left |  | The client coordinate with the left edge for the control.
TControl.Top |  | The client coordinate for the top edge of the control.