I’ve been searching for a solution to this for more than an hour but to no avail. I have a few other (movable) modal windows in my app that work as expected, but in this case the conditions are slightly different.
The modal window is a simple help screen which allows the user to show at startup or not. The other way of showing the window is by selecting a help menu item.
What’s happening is that on start up, the modal window is shown in front of the main window (all good), yet the main window still has the focus. No amount of ClearFocus, SetFocus seems to make any difference - it still will not receive the focus unless physically selected via the mouse.
In the open event of WindowMain:
If showHelpAtStartup = "True" Then // Show the help window as read from preferences
WindowHelpOVERALL.ShowModal
End If
However, if the modal window is instantiated in the main window via the Menu Handler, it works as expected.
In the Menu Handler, it’s the same code except for the If/End If block:
WindowHelpOVERALL.ShowModal
Like is said, it doesn’t seem like I can force the modal window to have the focus.
I’m just wondering if calling the modal window from the open event of the main window is the issue. If it shouldn’t be called from there, then where?
[2016R3 Win7]