Magerquark.de

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 event is passed to the control that has focus.

See also this Microsoft HOWTO article.

Kommentare

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre, wie deine Kommentardaten verarbeitet werden.