开发者

Handling Keyboard at Form level

开发者 https://www.devze.com 2022-12-09 13:45 出处:网络
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 开发

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消