Figure out if window is shown?

Hi again,

can I figure out if a window is shown?

like

if myWindow.shown = true then
do something
end

cheers and thanks again,
denis

myWindow.Visible = true?

This will open the window if it is not shown, but I don’t want to show it if it isn’t there :wink:

Then you’ve got Implicit Instance turned on. Which is ok, as it means you probably only have one of them at any given time. (I’m assuming you wouldn’t both use the window by name and create instances of it in code.) If so, you can loop through the Window() list and use ISA to find it without accidentally instantiating it.

dim isShown as boolean
for i as integer = 0 to WindowCount-1
   if Window(i) ISA myWindow then
       isShown = true
       exit
   end
next
if isShown then ...

The way how I do it, is to add a shared property called ‘isOpen’. In the open event of the window I set this to True, and false in the close event.

This way I can check to see if the window is open, without opening it to do so.

What a great idea… Sam…

I agree!
Great Idea!

Thanks for helping me out again :slight_smile: