[C#] Hotkeys

Soldato
Joined
12 Apr 2004
Posts
11,788
Location
Somewhere
Is there any way of making use of hotkeys without making Win32 API calls? I've tried using the following:
Code:
private void MainForm_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.R && e.Modifiers == (Keys.Shift | Keys.Control))
    {
        MessageBox.Show("Hotkey pressed!");
    }
}
...but this only works when the form itself has focus, which it doesn't when there are controls on it.

Is there a simple way around this?
 
Back
Top Bottom