'不要用子窗体,用 SetParent 将普通 Form 设为 MDI 子窗体:
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Const GWL_STYLE = (-16)
Const WS_POPUP = &H80000000
Private Sub Form_Load()
Dim Ret As Long
Dim CurrentStyle As Long
Ret = SetParent(Me.hwnd, MDIForm1.hwnd)
CurrentStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
Ret = SetWindowLong(Me.hwnd, GWL_STYLE, CurrentStyle Or WS_POPUP)
End Sub