EControl Form Designer Pro
TBaseDesigner.KeyDown Method

Respond to key press events.

procedure KeyDown(var Key: Word; Shift: TShiftState); virtual;


When a windowed control or design surface receives a key-down message (WM_KEYDOWN) from Windows, its message handler calls KeyDown, passing the key code and shift-key state in the Key and Shift parameters, respectively. 


KeyDown calls any event handler attached to the OnKeyDown event. Override KeyDown to provide other responses in addition to the event-handler call. 


The Key parameter is the key on the keyboard. For non-alphanumeric keys, you must use WinAPI virtual key codes to determine the key pressed. For more information, search for virtual key codes in the Win32 Developer's Reference (WIN32.HLP). 


The Shift parameter indicates whether the Shift, Alt, or Ctrl keys are combined with the keystroke. 


Either KeyDown or the OnKeyDown event handler it calls can suppress further processing of a key by setting the Key parameter to zero.

Copyright (c) 2004 - 2011 EControl Ltd.. All rights reserved.
What do you think about this topic? Send feedback!