Open new form when a button is pressed

I know this is really simple, but I just cant figure out what to type in order to fix it. My problem is that I have two forms in the same project. Say form1 and form2. I'm programming in VS 2005 using C#. I have a button in form1, and when I press it, I want form2 to open. What kind og code do I have to write in the eventhandler method for the button in form1 to open form2 if the button is pressed

I would really appreciate some help!


Answer this question

Open new form when a button is pressed

  • msdnjota

    Hi

    Form2 f = new Form2();
    f.Show();

    will show a new instance of Form2.

    HTH


  • Open new form when a button is pressed