Skip to content

Function Key Press Open New Window Form

g s

Asked May 11, 2015, 4:24 AM EDT2 answers
Share
LinkedInX
Function Key(F1,F2...F12) Press (Keyboard) Open New Window Form in C# Window Application 

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Manoj Bhoir
    0
    Hi,
    You can use this code :

    private void Form1_KeyDown(object sender, KeyEventArgs e)
    {
                if (e.KeyCode == Keys.F1)
                {
                    Form1 objForm1 = new Form1();
                    objForm1.Show();
                }
                if (e.KeyCode == Keys.F2)
                {
                    Form2 objForm2 = new Form2();
                    objForm2.Show();
                }
                if (e.KeyCode == Keys.F12)
                {
                    Form3 objForm3 = new Form3();
                    objForm3.Show();
                }
    }
    0