The Picture box control limits the available area for the MDI Child form in the MDI parent Form, so a "Classic" MDI child can overlap the Picturebox.
Using Windows API it is possible to modify the behaviour of MDI Child form; e.g. you can put a MDI Child in the Picture box using the SetParent API function:
Here's the code :
Code:
In the MDIForm parent :
Private Sub MDIForm_Load()
Form1.Show
DoEvents
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
Unload Form1
End Sub
In the Child form:
Code:
Private Sub Form_Load()
On Error Resume Next
DockWindow ' Without this, crash on exit due to SetParent in DockWindow??
End Sub
Public Sub DockWindow()
On Error Resume Next
' Some kind of problem with the Picture1.hwnd
Call SetParent(Me.hWnd, MDIForm1.Picture1.hWnd)
DoEvents
End Sub
And naturally the bas module with API declaration :
Code:
Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Long,_
ByVal hWndNewParent As Long) As Long