How to know if a window is instantiated, without instantiating it?

Hello all,
How can I programatically find out if a window has been instantiated? With implicit checked, code such as If Window1.Visible = True then xxx the window will be instantiated through that code.

What other ways are there to find out if a window exists?

Thank you,
Tim

You can’t really. You’d need to turn off ImplicitInstance, then you can track it yourself. Code such as “Window1.Visible = True” will no longer function though, you’ll need to reference a property used to store your window object, and create the window when you need it.

Thank you Thom,

That is what I thought, but thought there may be another way too.

Tim

I use the following:

if (WindowCount > 0) then for i as integer = 0 to (WindowCount - 1) if (Window(i) IsA Window1) then // do whatever you need to do here exit for i end if next end if

1 Like

[quote=29605:@shao sean]I use the following:

if (WindowCount > 0) then for i as integer = 0 to (WindowCount - 1) if (Window(i) IsA Window1) then // do whatever you need to do here exit for i end if next end if[/quote]

I was literally writing this same code when yours popped up :stuck_out_tongue:

Thanks Guys!
Tim