'patricktoulon exceldownload
#If vba7 Then
'trouver le handle
Private Declare ptrsafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Longptr
'on redessine la barre sinon elle se retrouve en bas de l'userform
Private Declare ptrsafe Function DrawMenuBar Lib "user32" (ByVal hwnd As Longptr) As Long
'afficher le userform 1 mode fenetre ,2 mode reduit , 3 plein ecran
Private Declare ptrsafe Function "ShowWindow" Lib "user32" (ByVal hwnd As Longptr, ByVal nCmdShow As Long) As Long
'application des modification
Private Declare ptrsafe Function SetWindowLongA Lib "user32" (ByVal hwnd As Longptr, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Dim handle As Longptr
#Else
'trouver le handle
Private Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'on redessine la barre sinon elle se retrouve en bas de l'userform
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
'afficher le userform 1 mode fenetre ,2 mode reduit , 3 plein ecran
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
'application des modification
Private Declare Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Dim handle As Long
#End If
Private Sub Label1_Click()
Unload Me
End Sub
Private Sub Label2_Click()
With Label1
If .Tag <> "3" Then .Tag = "3" Else .Tag = "1"
handle = FindWindowA(vbNullString, Me.Caption)
ShowWindow handle, Val(.Tag)
End With
End Sub
Private Sub Label3_Click()
handle = FindWindowA(vbNullString, Me.Caption)
showw handle, 2
End Sub
Private Sub UserForm_Activate()
handle = FindWindowA(vbNullString, Me.Caption)
SetWindowLongA handle, -16, &H140F0101 ' sans caption cadre epais coin arrondi et elastique
DrawMenuBar handle
End Sub
Private Sub UserForm_Resize()
Frame1.Width = Me.Width
For Each ctrl In Me.Frame1.Controls
i = i + 1
l = l + ctrl.Width
ctrl.Left = Frame1.Width - l - 10 - (i * 2)
Next
End Sub