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

# TCustomDBListBox.KeyDown

Handles key down events for the control.

## Declaration

Source position: dbctrls.pp line 367

`protected procedure TCustomDBListBox.KeyDown(`
`var Key: Word;`
`Shift: TShiftState`
`); override;`

## Arguments

`Key` |  | Virtual key code applied in the method.
`Shift` |  | Modifier for the key code applied in the method.

## Description

KeyDown is an overridden method in TCustomDBListBox which applies the specified virtual key code and modifier to the control. KeyDown calls the inherited method, and ensures that the linked dataset is updated as needed for the key down event. The following actions are performed for the corresponding keys:

VK_ESCAPE
  Calls the TFieldDataLink.Reset method to cancel the edit operation. Key is set to VK_UNKNOWN.
VK_DOWN, VK_UP
  Calls the TFieldDataLink.Edit method after changing the selected item in the control.

## See also

TFieldDataLink.Reset |  | Checks whether the link is active, calls the OnDataChange event handler then sets IsModified to False.
TFieldDataLink.Edit |  | Edit - if the field can be modified, performs inherited Edit and shows editing status.
TWinControl.KeyDown |  | Signals OnKeyDown event handlers (when assigned).