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

# TWinControl.DialogChar

Handles the specified key in Message as an accelerator or shortcut key.

## Declaration

Source position: controls.pp line 2267

`protected function TWinControl.DialogChar(`
`var Message: TLMKey`
`):Boolean; override;`

## Arguments

`Message` |  | Message with the character examined in the method.

## Function result

True if the key was handled.

## Description

DialogChar is an overridden Boolean function in TWinControl used to handle a character code in Message as an accelerator (or shortcut) key for a control. It re-implements the inherited method which always returns False. In TWinControl, the Message is sent to each of the children in Controls until one of them indicates that it responds to the accelerator key.

DialogChar is overridden in descendent classes to perform actions needed when the shortcut key is handled in the method. These classes allow the accelerator key to be defined using the Caption or Shortcut properties. Some examples include:

- TCustomGrid / TGrid
- TCustomButton / TButton
- TCustomLabel / TLabel
- TCustomStaticText / TStaticText
- TCustomSpeedButton / TSpeedButton

## See also

TControl.DialogChar |  | Performs actions needed to handle an accelerator key for the control.