Capture KeyUp event on form when child control has focus
- by Jon B
I need to capture the KeyUp event in my form (to toggle a "full screen mode"). Here's what I'm doing:
protected override void OnKeyUp(KeyEventArgs e)
{
base.OnKeyUp(e);
if (e.KeyCode == Keys.F12) this.ToggleFullScreen();
}
private void ToggleFullScreen()
{
// Snazzy code goes here
}
This works fine, unless a control on…