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

# TCustomUpDown.AssociateKeyDown

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

## Declaration

Source position: comctrls.pp line 1971

`protected procedure TCustomUpDown.AssociateKeyDown(`
`Sender: TObject;`
`var Key: Word;`
`ShiftState: TShiftState`
`);`

## Arguments

`Sender` |  | Control (Associate) generating the event notification.
`Key` |  | Virtual key code for the key down event.
`ShiftState` |  | Shift, Ctrl, or Alt modifier for the key down event.

## Description

AssociateKeyDown is assigned as an OnKeyDown handler routine for the control in the Associate property. It allows cursor keys (like Left, Right, Up and Down) entered in the Associate control to be applied to the Position in the Up/Down control. This includes using the Min, Max, and Increment values as needed for the Orientation in the control.

Key is set to 0 if the key down event is handled in the routine.

No actions are performed in the method if ArrowKeys is not enabled for the control, or when ShiftState is not an empty set (meaning no modifiers for the key event).