I'm looking for a best way to implement common windows keyboard shortcuts (for example Ctrl-F, Ctrl-N) in my winforms app in C#.
The app has a main form which hosts many child forms (one at a time). What I'd like to do is this: when a user hits Ctrl-F I'd like to show custom search form. The search form would depend on the current open child form in the application.
I was thinking of using something like this in the *ChildForm_KeyDown* event:
if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control)
// Show search form
But this doesn't work. The event doesn't even fire when you press a key. Any ideas?