Back to Devexpress

TdxCustomWizardControl.OnHandleChildControlKey Event

vcl-dxcustomwizardcontrol-dot-tdxcustomwizardcontrol-2a46274f.md

latest2.7 KB
Original Source

TdxCustomWizardControl.OnHandleChildControlKey Event

Enables you to respond to keystrokes that the focused child control accepts.

Declaration

delphi
property OnHandleChildControlKey: TdxWizardControlHandleChildControlKeyEvent read; write;

Remarks

This event occurs immediately after the focused child control on a wizard page processes a keystroke. You can handle this event to forbid the wizard control to respond to certain keystrokes while a specific child control on a wizard page has input focus. For instance, you can handle the event to allow a user to press the Enter, Esc, and Ctrl+A keystrokes to edit text in a memo editor on a wizard page, and avoid unintended navigation between wizard pages.

delphi
procedure TMyForm.dxWizardControl1HandleChildControlKey(Message: TCMChildKey; var AHandled: Boolean);
begin
  AHandled := 
    (((Message.CharCode = VK_ESCAPE) or // Checks if the Esc key is pressed
      (Message.CharCode = VK_RETURN) or // Checks if the Enter key is pressed
     ((Message.CharCode = 65) and (ssCtrl in KeyboardStateToShiftState)) and // Checks if the Ctrl+A key combination is pressed (the "A" key's virtual key code is 65)
      (Message.Sender is TcxCustomInnerMemo)); // Checks whether a memo on a wizard page accepts one of the three listed keystrokes
end;
cpp
void __fastcall TMyForm::dxWizardControl1HandleChildControlKey(const TCMChildKey &Message, bool &AHandled)
{
  AHandled =
    ((Message.CharCode == VK_ESCAPE) || // Checks if the Esc key is pressed
     (Message.CharCode == VK_RETURN) || // Checks if the Enter key is pressed
    ((Message.CharCode == 65) && (KeyboardStateToShiftState().Contains(ssCtrl))) && // Checks if the Ctrl+A key combination is pressed (the "A" key's virtual key code is 65)
     (Message.Sender->InheritsFrom(__classid(TcxCustomInnerMemo)))); // Checks whether a memo on a wizard page accepots one of the three listed keystrokes
}

Refer to the TdxWizardControlHandleChildControlKeyEvent procedural type description for detailed information on all parameters accessible within an OnHandleChildControlKey event handler.

Note

The OnHandleChildControlKey event does not occur if a keystroke message’s sender is a wizard control or one of its pages.

See Also

TdxCustomWizardControl Class

TdxCustomWizardControl Members

dxCustomWizardControl Unit