I have created two forms in C# using “Add new item”. Form1 is my default opening form. I’m using the following code to switch to form2:
Form1 class:
Form form2= new form2();
this.Hide();
form2.Show();
Form2 class:
what should i do here to open the same form1 again without creating the new instant of form1?
A simple solution could be showing the second form modally, then making the first form visible when the second form closes, like this:
Making this work non-modally is left as an exercise 🙂