A method for closing form1 then opening form2

Discussion in 'Programming General' started by Teh.One, Dec 19, 2009.

A method for closing form1 then opening form2
  1. Unread #1 - Dec 19, 2009 at 8:25 PM
  2. Teh.One
    Joined:
    Sep 18, 2009
    Posts:
    308
    Referrals:
    0
    Sythe Gold:
    0

    Teh.One Forum Addict
    Banned

    A method for closing form1 then opening form2

    Well, say you want to make a login system, you would want form1 to close then your form2 (program people register on your site or need a pass/auth code to see)

    Ok, so this is the code you would need.

    Code:
                    Form2 myForm2 = new Form2();
                    myForm2.Show();
    Code:
                Application.OpenForms["Form1"].Close();
    You add this in main method (in program.cs) under form1 one.

    Code:
                Application.Run(new Form2());
    That should help you if you made a login or auth system.
     
< Changing the size of an array | Java Form >

Users viewing this thread
1 guest


 
 
Adblock breaks this site