I have an windows forms application, with a form that holds 2 tabcontrols and a grid. I’d like to catch the pressing of esc key on any on this controls.
The question is : is it a simpler way to do that without subscribing to the keypress event on each control ?
Thanks!
You can Simply Do following.
Implement an
IMessageFilterand Handle Key Down event.Here is the complete Code to hook Escape Key Down.
Now you need to register this. The best place would be in Main