Handling Keyboard at Form level
I have a Form with several special controls on it that is the main window of my application. I would like to capture all key presses while my application is running, at the form level, rather than 开发者_高级运维on the focused control or anything like that. What is the standard way to do this in WinForms?
set Form.PreviewKeys = true, then you get all keyboard event.
Set the Form's KeyPreview property to true and then handle one of the keypress events.
精彩评论