> Is there a way to find out if an instance of a form is open? I have created
> a .net usercontrol that is attached to a main form. The control opens up
> another form. I would like to close it from the control that initiated it.
>
> Thanx,
> Poe
Hi Poewood
I can see two easy way, and one a little bit complex. You can keep a
reference to the Form, and whenever you need to know if it is
displayed, just check its Visible property. Or if you need to know when
it is closed, you can register a delegate to an event such as the
Disposed event. The more complex method is to use the FindWindow or
EnumWindows native API (using platform invoke) and to search the needed
form, then you can create a Form object around the handle that you have
received.
Alon Fliess
CTO
The Sela Group