MTSkull Posted November 28, 2006 Posted November 28, 2006 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 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(); } Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
Leaders snarfblam Posted November 29, 2006 Leaders Posted November 29, 2006 F10, like alt, accesses a windows menu. Even if your window doesn't have a menu it probably has a system menu (the one that shows up when you click the icon) Quote [sIGPIC]e[/sIGPIC]
MTSkull Posted November 29, 2006 Author Posted November 29, 2006 Is there a way to override this? Quote "Beer is proof that God loves us and wants us to be happy." -Benjamin Franklin
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.