I have two forms.
ie. formLogin, formMain
When a user clicks a button on formLogin I want the form to close and formMain to show.(or formMain to show and formLogin to Close)
I can't find any simple help on the internet and also I want to "Close" the form rather than Hide it.
I am new to c# so please help me.
THank You
How do I "Close" one form and show another ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Jul 29, 2012, 5:08 AM EDT
formMain mf = new formMain();
mf.Show();
this.Close();
However, notice that if formLogin is your start up form (i.e. the form which is specified in Application.Run in the Main() method of program.cs), then closing it will cause the entire application to close.
If that's the case, you'll either have to hide formLogin instead or make some other form the start up form.
Waqas Ali16 reputationPosted Jul 29, 2012, 9:07 PM EDT
You really cleared alot of my confusions.