We need to handle this event in the base form, regardless of which controls currently have focus. We have a couple of global key commands that need to work regardless of control focus.
This works by handling the PreviewKeyDown event in the form normally. When we add a user control to the form, the event no longer fires.
Am I missing something trivial here? Or do we need to handle the event in the user control first?
Thanks for your help!
Thanks Factor. When I get more time 🙂 I’ll get it working ‘properley’!
We ended up doing this:
I found a workaround for this by setting up a hidden menu item by setting:
(Thanks to this article).
It appears that the Main Menu of a form always gets searched for your shortcut key combination. This works regardless of whick control has focus