To quote an article on MSDN
(
http://msdn.microsoft.com/library/de...owntopic.asp):
Key events occur in the following order:
KeyDown
KeyPress
KeyUp
To handle keyboard events only at the form level and not allow other
controls to receive keyboard events, set the KeyPressEventArgs.Handled
property in your form's KeyPress event-handling method to true. Certain keys,
such as the TAB, RETURN, ESCAPE, and arrow keys are handled by controls
automatically. In order to have these keys raise the KeyDown event, you must
override the IsInputKey method in each control on your form. The code for the
override of IsInputKey would need to determine if one of the special keys is
pressed and return a value of true.
Brendan
"ZS" wrote:
Hi,
On a form , I'm trying to trap when a shift key is pressed.
Can someone explain how the KeyUp,KeyDown and Key Press event works for Forms.
Thanks
-ZS