Hi - as per the title - in Rhino6, I see a random situation where the following code opens my form UNDER the Main Rhino UI panel (so there is a second icon on the Windows toolbar, and the Rhino window has to be moved to see my form). This does NOT happen in Rhino5. My code is…
If you want to show the dialog in modal fashion, use ShowModal(...). This will force the dialog to be in front of Rhino, but does not allow interaction with Rhino while the dialog is open.
Ok, first ensure that the owner is correctly set (Control.FromHandle should not be null). If that does not solve the problem, you could subscribe to the RhinoApp.Idle event, and when that fires, set the form.TopMost = true or call form.Focus().
I have some more info on this - and it looks like a Rhino6 bug to me.
In summary…if I open the Octane Viewport, there is some time loading geometry and then the modeless form opens. If during the loading of geometry I task swap to another application, the modeless form will never display. I cannot find it when Alt-tabing.
Rhino.RhinoApp.MainWindowHandle() is not null.
If I add form.TopMost = true in the Idle event, the modeless window is displayed, however it is always on top of all windows of all applications, which is not what I want.
If I add form.Focus() or BringToFront() in the Idle event, it does not fix the problem (window still not visible).
So as you can see, it appears that Rhino6 is not correctly handling this situation where Rhino5 does.