EControl Form Designer Pro
TBaseDesigner.KeyPress Method

Respond to keyboard input.

procedure KeyPress(var Key: Char); virtual;

When a windowed control or design surface receives a key-press message (WM_CHAR) from Windows, its message handler calls KeyPress, passing the key code in the Key parameter. 


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


Either KeyPress or the OnKeyPress event handler it calls can suppress further processing of a character by setting the Key parameter to zero. 


Note: The Key parameter is the character represented by the key that is pressed, not a Windows virtual key code.

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