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

# TCustomDBComboBox.KeyDown

Performs actions needed to apply the key down event.

## Declaration

Source position: dbctrls.pp line 770

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

## Arguments

`Key` |  | Virtual key code handled in the method.
`Shift` |  | Key modifier handled in the method.

## Description

KeyDown is an overridden method in TCustomDBComboBox, and calls the inherited method on entry. It ensures that a virtual key which affects the datasource state is applied to the control. KeyDown handles the following virtual key codes:

VK_ESCAPE
  Editing is cancelled. Calls the Cancel method in the linked dataset when the datasource is in an edit state. Calls the Reset method for the data link if the datasource is not being edited. Calls SelectAll to re-select content in the control. Sets Key to VK_UNKNOWN after applying the original virtual key code.

## See also

TFieldDataLink.Reset |  | Checks whether the link is active, calls the OnDataChange event handler then sets IsModified to False.
TDataLink.DataSource
TDataLink.DataSet
TDataSet.Cancel
TCustomComboBox.KeyDown |  | Filters keys used to traverse the list.