We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Platform : Windows Forms
|
Category : Keyboard Handling

How can I listen for certain keys at the Form level irrespective of which Control has the focus?

When the Form.KeyPreview property is set to true, the Form’s KeyPress, KeyDown and KeyUp events will be fired even before the Control with the focus’ corresponding events. You may choose to forward these message to the Control after processing them in the Form’s event handlers (this happens by default) or set the e.Handled property to true (in the event argument) to prevent the message from being sent to the Control with focus.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.