How can make shortcut keys in my windows form?

Total Post:117

Points:821
C# 
C#
 1544  View(s)
Ratings:
Rate this:
I need to make a shortcut key for open a new form in my application how I can do that task.
  1. Post:154

    Points:1086
    Re: How can make shortcut keys in my windows form?

    1.    Create a demo project with 2 windows form

    2.    Then you can add the below code in your form1_keyDown event

    if
    (e.Control && e.KeyCode == Keys.N)
    {
         Form2 f2 = new Form2();
         f2.Show();
    }

    e.Control : This mean hold the control key

    e.KeyCode == Keys.N: This mean press the N key form your keyboard

      Modified On Mar-31-2018 06:41:52 AM

Answer