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
Loading
VulpesPosted Jul 29, 2012, 9:08 AM
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 AliPosted Jul 30, 2012, 1:07 AM
You really cleared alot of my confusions.