Specifies whether a form's KeyPress event intercepts the KeyPress events of a control. Available at design time and run time.
Applies To:| | |
The KeyPreview property is used to allow the form to handle KeyPress events before the active control processes them.
You can use this property to create a keyboard-handling procedure for a form. For example, when an application uses function keys, you can process the keystrokes at the form level rather than writing code for each control that can receive keystroke events.
If a form has no visible and enabled controls, it automatically receives all keyboard events.