• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

How to determine Form variable is valid and points to an open form

I have a .Net 4 Windows Forms project created with Visual Studio 2010 using c#.

I have a method which recieves a pointer to a form which was previously opened.  How can I test that this varialble point to a valid and still open form (ie the user has not closed it)?
0
canuckconsulting
Asked:
canuckconsulting
1 Solution
 
Jacques Bourgeois (James Burger)PresidentCommented:
if (!(<variable>==null && <variable>.Visible==true)
{
   // Form is ready
}

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now