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

# TCustomTabControl.KeyDown

Handles page navigation using the Tab key.

## Declaration

Source position: comctrls.pp line 445

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

## Arguments

`Key` |  | Virtual key code examined in the method.
`Shift` |  | Key modifier(s) used in the method.

## Description

KeyDown is overridden in TCustomTabControl to handle use of the Tab key (VK_TAB) to change the active page in the tabbed control.

The Options property must contain the value nboKeyboardTabSwitch to enable the tab switching feature. Pressing Ctrl+Tab switches to the next page by incrementing the PageIndex value. Pressing Ctrl+Shift+Tab switches to the previous page by decrementing the PageIndex value.

If Key is not the VK_TAB virtual key code, the inherited method is called to handle the values in Key and Shift.

## See also

TCustomTabControl.Options |  | The set of Options enabled for the tabbed control.
TCustomTabControl.PageIndex |  | Ordinal position for the selected page on the tabbed control.
TCTabControlOption |  | Represents the LCL options available for TCustomTabControl.
TWinControl.KeyDown |  | Signals OnKeyDown event handlers (when assigned).