In my Windows Forms application I would like one special button to run a test everytime I press it. There are dozens of controls so implementing it in each one takes too much time.
Is there a way I can set a hotkey so, no matter what I am doing in the application, I can press the key, and it will fire off my event?
You can override
ProcessCmdKeyand handle your hotkeys there, either in a control or a form.From MSDN:
For example: