Plain Box in Modal

From window main I show a info window that is a plain box. I show in modal but after show it I can use window main again.
I would like to see the window plain box and can’t do anything else until I close.
How can I do it?

Use ShowModal() instead of Show().

And make the window a modal dialog instead of a simple plain box.

In main window I use winInfo.ShowModal where winInfo is plain box.
But when the plain box appears I can still click on main window and plain box loses focus, and I don’t want this. The plain box loses focus and ends below the main window, bad thing.

As Michel has posted twice: the Frame property of the window needs to be set to one of the modal dialogs:

Movable Modal window Modal Dialog box Sheet window (displayed as such on Mac OS X only)

I use Windows os. I know that if set Movable Modal or Modal Dialog box work, but there are the widow borders, no plain box.

Put this in Open :

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (hwnd As Integer, nIndex As Integer, dwNewLong As Integer) As Integer Const GWL_STYLE = -16 dim rien as integer = SetWindowLong(self.handle, GWL_STYLE, &H800000)

@Michel Bujardet Good Idea!

I’m having a similar issue with Xojo2016R3 / WIN7.

I’ve used the above code posted by Michel and have set the frame type to modal dialog, then open the window using Window.ShowModal.

The problem I’m having is there is a 2 pixel white border. This can be seen in the image below where the red coloured “modal window” should slot cleanly at top left into the panels which are shown from the window underneath.

A plain frame type looks perfect to what I want, but (as already pointed out) suffers from the issue of the user being able to select the window underneath, which then comes to the top obscuring the window the user needs to work with.

Maybe it’s a Windows 7 thing?