Hi i’m doing a simple activity in c# . i want to open a new form2 using a button and the form1 will automatically close when i press that button .Here’s My code:
Form2 form2 = new Form2();
form2.ShowDialog();
this.Close();
Now i don’t have idea What method will i use to close automatically the form1. Thank you..
Instead of using
this.Close();usethis.Hide()and on formclosing event ofForm2giveform1.Show().for more information go through this link (I asked this question before).