Document Window show/hide

Sorry for this probably stupid question – I spent 2 hours trying to understand what is happening, but…

My application has 3 windows (Window1, Window2, Window3) all 3 are of the Document type.

When the application opens, Window1 has to be shown. A file is loaded.
If it is loaded for the first time, pressing on the NEXT button, will close Window1 and open Window2. Window 2 contains instructions for the user.
If it has been loaded before, the user had read the instructions before, so Window1 closes and Window3 should open.

I’m using
Window3.Show ( )
Window.1Close ( )
when I want to skip Window2.

Strange thing is that I always seem to call Window2 even though I want to skip it. It always shows up.

My questions:

  1. Is Document type what I need for the 3 windows?
  2. Does the order of showing and closing a window matter?
  3. Is there anything that can trigger this unwanted behavior?

thanks

Gert

Hi,

Reply to your question no 3: Implicit instantiation. Check this: http://documentation.xojo.com/index.php/Window.ImplicitInstance

Julen

thanks Julen.

I get somewhere, but I get stuck again. I created a small test-application with 3 Windows

So: on App I create 3 properties:
w1 as Window1
w2 as Window2
w3 as Window3

The 3 windows exist and have all Implicit Instance OFF
on App I created an Open Event that initiates w1:
dim w1 as new Window1

This immediately opens Window1

On a button in Window1 I create a pushbutton with an Action event:
dim w2 as new Window2

This opens Window2 all right.

How do I close Window1? I don’t find it. I always get exception errors…
App.w1.Close
does not work either, but the autosuggest works :wink:

thanks

Gert

Window1.Close seems to be working.

This sounds more like a ‘Wizard’ dialog.

Have one window only.
Onto that, put pagepanels or container controls.
Show and hide the panels based on your rules.

[quote]
Window1.Close seems to be working.[/quote]
Then implicit instantiation is still turned on, and Window1 is the default window.