Close windowB from WindowA

I have 2 windows WindowA which is main and WindowB which open upon event.

Dim prompt As WindowSelectCustomer prompt = New WindowSelectCustomer prompt.ShowModalWithin(WindowSelectCustomer)

I have try to close WindowB from WindowA with


and with

for i as integer = 0 to WindowCount - 1 if window(i) isa WindowSelectCustomer then window(i).close end next i

But windowB doesn’t close. It close if i click on button in WindowB with


You should make prompt a property of WindowA instead of DIMming it. Then you do


I have created a new property prompt As WindowSelectCustomer -> Global

In code I open new window

prompt = New WindowSelectCustomer prompt.ShowModalWithin(WindowSelectCustomer)

But I can’t close it with


You are showing the window within itself. Why ?

The app is on 7" lcd in full screen with auto start, user has only mouse, if they get new window behind first one, they can’t interact with it.

From what I see in your code, there is no window named WindowSelectCustomer since you instanciate them from a property.

There probably lies the issue.

Try this if what you want to do is display B into A, from A :

prompt = New WindowSelectCustomer prompt.ShowModalWithin(self)

I try also this one but no luck.
I have created function and timer in WindowB to check if it is time to close, this works.
But I would still like to found out what went wrong with my first method.

I have no idea what you may be doing that creates the issue.

What happens if instead of showModalWithin you simply show ? Can you close the window afterward ?

Perhaps the problem is platform that I use Linux ARM. If I use show instead showModalWithin doesn’t make any difference.

Cannot help you with that. Never worked with ARM.

There is something definitely wrong somewhere.

Maybe time to file a bug report, with attached a sample project that demonstrates the issue.

Since apparently self.close works, you could create a public method for instance “CloseMe” on the window, that you call when you want to close it.

Sub CloseMe self.close end sub

So to close prompt, you go