none
Use Hotkey (F1,F2 ...) in c# RRS feed

  • Pergunta

  • Hello everybody I'm starting a new project and would like to know how
    I use the hotkeys (F1-F2) to open other forms different.
    Initially I used only to test this code:

     private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
          if (e.KeyData==Keys.F1) MessageBox.Show("yesye");
        }
    
        private void Form1_Load(object sender, EventArgs e)
        {
    
        }
    
        private void Form1_KeyPress(object sender, KeyPressEventArgs e)
        {
          if (e.KeyChar=='a') MessageBox.Show("yesye");
        }
    but unlike what happened with other other projects where I tested this code on my newproject did not work.
    The only difference in the project that the code worked and what did not work on the project that was used in a MenuStrip and the other not.

    quarta-feira, 23 de março de 2011 20:47

Respostas

Todas as Respostas