Sign in Join
FPDoc Onlineexperiment

TWinControl.DialogChar function

Member of TWinControlprotectedIn unit Controls

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

Declaration

pascal
function DialogChar(var Message: TLMKey): Boolean; override

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

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.