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)?
canuckconsultingAsked:
Who is Participating?
 
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.

All Courses

From novice to tech pro — start learning today.