I have a form "fm" that is a simple info window that opens every 10 mins (fm.Show();
).
How I can make that every 10 mins it will check if the form "fm" is open and if it is open it closes it and open it again!
Now the form fm is always created with form fm = new form();
so when I try to check if the form is open it will always be false and open a new window even if there is one form before!
I need to have a tool to give it a unique identity and then check if this form with unique identity is opened or not!
I do not want to just update the data on the form (fm), because I have a complicated info with buttons.
The form name is "UpdateWindow"
Solved using the following:
Form fc = Application.OpenForms["UpdateWindow"];
if (fc != null)
fc.Close();
fc.Show();
try this
Form only once
If your goal is to diallow multiple instaces of a form, consider following ...
Try This This is the short idea to check Form open or not open
The below actually works very well.
* Hope This will work for u
This is what I used to close all open forms (except for the main form)