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 Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _ ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Sub Form_Activate() Dim lStyle As Long Dim RectMdi As RECT GetWindowRect MDIForm1.hwnd, RectMdi lStyle = GetWindowLong(MDIForm1.hwnd, (-16)) lStyle = lStyle And Not &H80000 lStyle = lStyle And Not &H10000 lStyle = lStyle And Not &H20000 lStyle = lStyle And Not &HC00000 '===================>> mets en commentaires si tu veux ler caption SetWindowLong MDIForm1.hwnd, (-16), lStyle SetWindowPos MDIForm1.hwnd, 0, RectMdi.Left, RectMdi.Top, RectMdi.Right - RectMdi.Left, RectMdi.Bottom - RectMdi.Top, &H40 End Sub
Mets ce code dans le module de la Form Fille :Bonjour ucfoutu,
Ta MDI devant, dans cet exemple, être nommée MDIForm1
Fonctionne bien (également vérifié) même si menu présent dans MDI.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question