Sign in Join
FPDoc Onlineexperiment

TCustomCheckListBox.KeyDown procedure

Member of TCustomCheckListBoxprotectedIn unit CheckLst

Handles key down messages for the control.

Declaration

pascal
procedure KeyDown(var Key: Word; Shift: TShiftState); override

Arguments

Key

Keystroke examined in the method.

Shift

Shift, Control, or Alt modifier for the keystroke.

Description

KeyDown is an overridden method in TCustomCheckListBox used to handle key down messages for the control. KeyDown ensures that the value for the current check box is toggled when the Space key is pressed while the control has focus.

This includes setting ItemIndex to 0 when it has a value not valid for the Items defined in the control. The inherited Click method is called if ItemIndex is range adjusted. This behavior is Delphi (version 7 at least) compatible.

If the check box at ItemIndex has its ItemEnabled property set to True, the value in Checked is toggled. The ClickCheck and ItemClick methods are called to trigger the corresponding event handlers. The value in Key is set to VK_UNKNOWN when the keystroke has been handled in the method.

The inherited KeyDown method is called to handle other key down events.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.