Program start

XOJO 2018r4 / Windows.

I will try to explain what I like to do :
I have a App that has a DefaultWindow for startup.
Now I would like to add some code in the App.Open event that checks some folder and file existants.
If there are files in the folder then the App should start with the DefaultWindow but when there are no files in the folder the App should first run another Window to manage the files in the folder.
The problem is that when there are no files in the folder the other window opens, but also the DefaultWindow opens.
How can I prevent the DefaultWindow to open before the other window is closed.

Regards
Etienne

I think I found a solution.
I set the DefaultWindow to None.
In the code (App.Open) I check the folder.
Depending on the result I open the other window as ShowModal or I continue the normal flow.
At the end of the App.Open I show the window that normally was set as DefaultWindow.

It works fine this way. Is this a correct way to handle my problem ?

Regards
Etienne
.

you can also open your main window in your checkfiles window

your check for files window do not need to be visible if everything is ok.

start->check->main

Self.Close Dim main As New MainWindow main.Show

something like this

Dim check As New CheckWindow
if check.TestFiles() = False then
check.Show
else 
 Dim main As New MainWindow
 main.Show
endif