I have Form1 and Form2 and C#.
How can I show the Form2
Printable View
I have Form1 and Form2 and C#.
How can I show the Form2
Form2 myForm;
myForm.ShowDialog(); //spelling might be incorrect..
Form2 myForm = new Form2();
myForm.ShowDialog();
Nobody likes null pointer exceptions.
I have done the following from Form1
Form2 myForm = new Form2();
myForm.Show();
but if I close the initial form that I called this from then the Form2 also is close.
How can I close the calling form, without newly opened form from also closing?
Instead of closing Form1,
Form1.Visible = false;
That still means its in memory and running in the background.
What if a user clicks the X button in the top right, it will still close.
Any better ways to do this.