Q

How to check if a Form has been loaded

How can I check whether a Form has already been loaded or not?
There's no direct way to check if a particular form is loaded. One way to solve the problem is to create a static property in the form class and set that static variable to true when you load the form and when you close the form, set it to false. Of course you'll have to handle the Loaded and Closed events to properly set the static variable. If you want to get the instances of the loaded forms, you could have a static array that you add and remove form instances to, you could do that as well.
This was first published in April 2004

Dig deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close