MTSkull
Centurion
I am creating an F Key switch based on the form keydown event. When I run the app and press the F10 key, the execution freezes for a minute before releasing and letting me press keys again. I suspect that when I press F10 it is doing or trying to do something. Any hints?
MT
MT
C#:
private void frmShell_KeyDown(object sender, KeyEventArgs e)
{
//fKeys event handler
switch (e.KeyCode)
{
case Keys.F1:
this.Text = "F1 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F2:
this.Text = "F2 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F3:
this.Text = "F3 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F4:
this.Text = "F4 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F5:
this.Text = "F5 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F6:
this.Text = "F6 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F7:
this.Text = "F7 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F8:
this.Text = "F8 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F9:
this.Text = "F9 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F10:
this.Text = "F10 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F11:
this.Text = "F11 Key Pressed" + ", " + e.KeyCode.ToString();
break;
case Keys.F12:
this.Text = "F12 Key Pressed" + ", " + e.KeyCode.ToString();
break;
default:
this.Text = e.KeyCode.ToString(); ;
break;
}
this.Update();
Application.DoEvents();
}