Welcome! Log In Create A New Profile

Advanced

Re: MDI Window switching

Posted by sivakrith 
Re: MDI Window switching
August 26, 2019 07:50AM
Hello,

Windev 22

Need to close one MDI Window and switch (back) to another MDI Window.

Got two MDI Parent windows, with their own menu(s). Menu(s) do open other (Form & browse) window(s) with OpenChild command.

MDIWindow1 is opened after successful login. Here few menu(s) are there to enter few basic data. From here user could either close application or open MDIWindow2. This could be done, by passing one parameter, at Application init.

Now, from MDIWindow2, I want to give an option either to close application or open MDIWindow1 from a menu item (Switch). If the user clicks (Switch), then this MIDWindow2 need to be closed and MDIWindow1 to be opened.

Issue is, after closing MDIWindow2 and opening MDIWindow1, any openchild command doesn't show up in MDIWIndow1. If he check with WinStatus, it says that particular window is already open, but we could not view it. Seems Parent of the Child window is still set to MDIWindow2 and not with MDIWindow1, even though MDIWindow2 is closed.

Code in Switch menu item in MDIWindow2
IF WindowCount() > 1 THEN
Info("Close all open windows before proceeding.")
END
Open(MDIWindow1)
Close(MDIWindow2)

Is there any way to set the 'parent' of current openchild (command) to MDIWindow1 from MDIWindow2 ? Or any other way to accomplish this feature ?

Happiness Always
BKR Sivaprakash
Re: MDI Window switching
August 27, 2019 09:15AM
Sorry,

With no confirmation, and hang of my machine thrice, about my post here, I had to repeat the same, which has created more than one thread. Please ignore the repeated threads.

Btw, is there any way to delete duplicate thread ?

Happiness Always
BKR Sivaprakash
jose antonio
Re: MDI Window switching
August 28, 2019 12:25AM
Hi, did you try with

OpenChild(WIN_MyChildWindow)
WinStatus(WIN_MyChildWindow,TopActive)

Regards,
José Antonio.
Re: MDI Window switching
September 04, 2019 09:44AM
Thanks José Antonio.

With a infinite loop, in Appl init, and a return value from MDI windows, I could resolve this issue. Nevertheless I'll try your suggestion also.

Happiness Always
BKR Sivaprakash
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: