P
ppcdev
Hi.
Actually, i'm working on C# projects in some french companies.
Would anyone know how to know if a "form" is currently running in
background ?
Actually, I've implemented the following test in an application :
Form myFormHandle = new Form1();
this.mySavedForm1 = myFormHandle;
Form myFormHandle2 = new Form2();
this.mySavedForm2 = myFormHandle2;
public Form mySavedForm1;
public Form mySavedForm3;
....doing many many processes...
....then switch to form2 (eg: Form2.Show());
When I need to go back to Form1 from Form2, here's how I think :
"Ok, starting point = I'm on Form2"
"Is Form1 already existing ?"
"If yes, just show it"
"If not, recreate it"
Here's how I translate this into the computer world :
(I'm on Form2)
if (Form1.mySavedForm1!=null) Form1.mySavedForm1.Show()
else
Form1 form1 = new Form1();
form1.mySaveForm1 = form1;
form1.mySavedForm1.Show();
..... The problem seems to be on the "null" comparison... Is is a
correct thing to compare form handles to null ?
Thank you very much, microsoftmen!
Actually, i'm working on C# projects in some french companies.
Would anyone know how to know if a "form" is currently running in
background ?
Actually, I've implemented the following test in an application :
Form myFormHandle = new Form1();
this.mySavedForm1 = myFormHandle;
Form myFormHandle2 = new Form2();
this.mySavedForm2 = myFormHandle2;
public Form mySavedForm1;
public Form mySavedForm3;
....doing many many processes...
....then switch to form2 (eg: Form2.Show());
When I need to go back to Form1 from Form2, here's how I think :
"Ok, starting point = I'm on Form2"
"Is Form1 already existing ?"
"If yes, just show it"
"If not, recreate it"
Here's how I translate this into the computer world :
(I'm on Form2)
if (Form1.mySavedForm1!=null) Form1.mySavedForm1.Show()
else
Form1 form1 = new Form1();
form1.mySaveForm1 = form1;
form1.mySavedForm1.Show();
..... The problem seems to be on the "null" comparison... Is is a
correct thing to compare form handles to null ?
Thank you very much, microsoftmen!