EEssam
asked on
How can I prevent running multiple instances of a form?
Hi,
I have a button with the following code:
FormPrefs FP = new FormPrefs();
FP.Show();
How can I only allow one instance of FormPrefs to run?
Thanks.
I have a button with the following code:
FormPrefs FP = new FormPrefs();
FP.Show();
How can I only allow one instance of FormPrefs to run?
Thanks.
If you don't use new, only one form will be showed.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, if you use it as a mdichild form, you can add this line UniqueForm.BringToFront() after UniqueForm.Show() so the form will go to the top of your mdiontainer (form).
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.