PDS8475
Active member
- Joined
- Jun 25, 2019
- Messages
- 41
- Programming Experience
- Beginner
Hi I have two forms
Welcome_form
Repairs_form
The Repairs_form has a cancel button
in the click event of the cancel button I have wrote
Also on the form closing event of the Repairs_form I have put
I need code to open the Welcome_form
when the Repairs_form is closed
However because of this clicking the cancel button causes two instances of the Welcome_form to open
How do I go about creating an If statement on the form closing event to check if the Welcome_form is already open
I take it would be something like
Thanks in advance
Welcome_form
Repairs_form
The Repairs_form has a cancel button
in the click event of the cancel button I have wrote
C#:
N = TempName_label.Text;
Welcome_form wel = new Welcome_form(N);
wel.Show();
this.Close();
Also on the form closing event of the Repairs_form I have put
C#:
N = TempName_label.Text;
Welcome_form wel = new Welcome_form(N);
wel.Show();
I need code to open the Welcome_form
when the Repairs_form is closed
However because of this clicking the cancel button causes two instances of the Welcome_form to open
How do I go about creating an If statement on the form closing event to check if the Welcome_form is already open
I take it would be something like
C#:
if (Welcome_form.Exists = false ) {
N = TempName_label.Text;
Welcome wel = new Welcome(N);
wel.Show();
}
Thanks in advance
Last edited: