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

# TDBLookupComboBox.KeyDown

Handles the Null key shortcut in key down events.

## Declaration

Source position: dbctrls.pp line 907

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

## Arguments

`Key` |  | Key examined in the method.
`Shift` |  | Modifier(s) for the key examined in the method.

## Description

KeyDown is an overridden method used to handle and apply virtual key code messages (WM_KEYDOWN) received in the control. Key and Shift contain the virtual key code and the Shift-Ctrl-Alt modifiers for the message.

KeyDown ensures that the shortcut in NullValueKey is applied to the TDBLookup and the ItemIndex for the control. KeyDown calls the inherited method prior to exit.

## See also

TDBLookUpComboBox.NullValueKey |  | Keyboard shortcut which causes an empty value to be assigned to the field value for the lookup control.
TCustomDBComboBox.KeyDown |  | Performs actions needed to apply the key down event.
TCustomDBComboBox.ItemIndex |  | The index of the currently selected item, or -1 if no item is selected.
TDBLookup |  | TDBLookup - used as source of data by TDBLookupListBox or TDBLookupComboBox, to find data from a lookup table.