• Log in or sign up for an account here: https://www.sythe.org/login

A method for closing form1 then opening form2

Teh.One

Forum Addict
Joined
Sep 18, 2009
Sythe Gold
0
Messages
308
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.
 
Runescape Gamblingrunescape gambling
Back
Top