Hello all,
I am working on a project using Windows Forms, and I ran into a bit of a
snag... I need to be able to use keystrokes as shortcuts in the program,
and I currently accomplish it using the following:
-----[ Begin code snip ]-----
protected override void OnKeyPress (KeyPressEventArgs e) {
switch (e.KeyChar) {
case 'b':
e.Handled = true;
mnuNavigationBack.PerformClick();
break;
case 'f':
e.Handled = true;
mnuNavigationForward.PerformClick();
break;
default:
break;
}
base.OnKeyPress(e);
}
-----[ End code snip ]-----
Everything works great until the user opens another window (such as say
an About dialog or a MessageBox)... Once the other dialog is opened,
closed, and the focus is redirected back to the main form, the
keypresses are no longer registered with the main form...
Does anyone know why this would happen?
I searched through the list archives via groups.google.com, and couldnt
find anything referring to anything close to this...
Any advice would be much appreciated.
Thanks!