Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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();
       }

"Beer is proof that God loves us and wants us to be happy."

-Benjamin Franklin

  • Leaders
Posted
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)
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...