roujesky
asked on
Winforms -- Capture CTRL+SHIFT+D at the form not working?
I want to capture CTRL+SHIFT+D in my application. I have a winform application that has split container, panels, buttons, etc. Should be straightforward, I created:
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.Shift && e.KeyCode == Keys.D)
{
do something
}
}
The problem is I am not getting to the first line of the method. I set a breakpoint. Never hit it. I *SUSPECT* the problem is that there are lots of controls on the form and the form doesn't have focus so does not receive the keys. Something is intercepting them because it may have focus????
So, is there a way to capture the keys at the application level? Or, is there a better way to approach this?
thanks!
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.Shift && e.KeyCode == Keys.D)
{
do something
}
}
The problem is I am not getting to the first line of the method. I set a breakpoint. Never hit it. I *SUSPECT* the problem is that there are lots of controls on the form and the form doesn't have focus so does not receive the keys. Something is intercepting them because it may have focus????
So, is there a way to capture the keys at the application level? Or, is there a better way to approach this?
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER