Windows Forms: Handle Keyboard Input at the Form Level
To handle keyboard input in code on a form level, even if a control on the form currently has the focus, simply set the KeyPreview property of the form to true. This configures that the form will receive key events before the…