Hello all,
Is there a way to activate a window while another window is being active?
Thanks!
Hello all,
Is there a way to activate a window while another window is being active?
Thanks!
You can’t have two windows active at the same time, but if you want to activate a window from an active window, use DesktopWindow.Show
It’s understood that there is one active window at any time. I tried Show, but it does not activate it. The window that executes Show still is active.
Where do you call show? and how?
If the window you want is an implicit instance, it’s simply TheWindowIWant.Show.
The execution flow is:
-App starts
-Window A opens
-Window B opens
-Done with B now. Keep it open, but want A activate.
A.Show() (From B; still not activating A)
Even this sequence doesn’t activate A:
-App starts
-Window A opens
-Window B opens
-Done with B now.
-Back at A.open() event handler:
A.Show(). Still don’t see A activated (the title of B still bold while A’s not.)
Sounds like you’re still in A.Open. You need to get out of the event sequence. Maybe open B from a short-period timer.
Can you share a sample, it will be easier to point you in the right direction if we can see the code that you use.
Tim: A is open and yet cannot be activated while processing open event?
So your App’s default Window is WindowA and you have this in the opening event?
WindowB.Show
WindowA.Show
and you end with WindowB active above WindowA, right?
Alberto, that’s correct.
As we don’t have much information about your goal, you can:
There is some explanation about why you are not getting what you expect in the documentation, but not sure right now where.
Are you familiar with Timers?
If you have a default window, it should appear without your even calling Show.
Alberto, yes, I can use Timer.
Jerry, both are shown, the desire is to activate A.
Correct, WindowA appears as is the default window,
I’m not sure if it was clear that for the App we can change the default window to None, then in the App Opening event put:
WindowB.Show
WindowA.Show
and that will put WindowA on top of WindowB
to make both windows show but WindowA will be active and in front of WindowB.
Understood. My point was more that Window.Show and Default Window are really redundant here. So yes, if we need to have a “default” window at all, make it WindowB and not Show it. You could possibly even put WindowA.Show in WindowB’s Open/Opening event.
Solution found: Make WindowB default (previously it was A), at the end of B’s show event, A.Show() would activate A. Thank you, AlbertoD.
However, it should make sense that, whether a window is default or not, we should be able to activate a window from another one.
Thanks to all contributions, suggestions and comments!
That is correct. There is a lot going on behind the scenes in the Open sequence.
Also note, FWIW, that the Activate event fires after the Open event.