Thanks.
For the dragging problem on the new 'MDIChild', I found something like this in EE.
But it still doesn't act like 'normal MDIChild'. Maximize Form2 and the titlebar doesn't merge with MDI.
VB Code:
' Needs 2 forms. Form1 is MDIChild and startup form. ' Place one button in Form1 ' Inside Form1 Option Explicit 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 Private Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" ( _ ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_CHILD = &H40000000 Private Sub Command1_Click() Dim m_oldstyle As Long Load Form2 SetParent Form2.hwnd, MDIForm1.hwnd m_oldstyle = GetWindowLong(Form2.hwnd, GWL_STYLE) Call SetWindowLong(Form2.hwnd, GWL_STYLE, (m_oldstyle Or WS_CHILD)) Form2.Show vbModeless Form2.Move 0, 0 End Sub




Reply With Quote