V
violaine
Guest
bonjour j'utilis le code suivant pour mettre en plein ecran mes userform mais le probleme est que je n'ai plus la petite croix pour fermer ma feuille comment faire
merci
Private Declare Function FindWindowA Lib 'User32' (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLongA Lib 'User32' (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLongA Lib 'User32' (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Sub UserForm_Initialize() 'Permet de mettre en plein écran la Form
'Pour mettre en plein écran la Form, il faut copier coller ci-dessous dans UserForm_Initialize
' ET copier coller les 3 lignes de déclaration ci-dessus (ça se complique un peu la gestion des affichages)
Dim hWnd As Long, exLong As Long, zFactor As Integer
hWnd = FindWindowA(vbNullString, Me.Caption)
exLong = GetWindowLongA(hWnd, -16)
If exLong And &H880000 Then SetWindowLongA hWnd, -16, exLong And &HFF77FFFF
zFactor = 100 * CInt(Application.Width / Me.Width)
Me.Width = Application.Width
Me.Height = Application.Height
End Sub
merci
Private Declare Function FindWindowA Lib 'User32' (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLongA Lib 'User32' (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLongA Lib 'User32' (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Sub UserForm_Initialize() 'Permet de mettre en plein écran la Form
'Pour mettre en plein écran la Form, il faut copier coller ci-dessous dans UserForm_Initialize
' ET copier coller les 3 lignes de déclaration ci-dessus (ça se complique un peu la gestion des affichages)
Dim hWnd As Long, exLong As Long, zFactor As Integer
hWnd = FindWindowA(vbNullString, Me.Caption)
exLong = GetWindowLongA(hWnd, -16)
If exLong And &H880000 Then SetWindowLongA hWnd, -16, exLong And &HFF77FFFF
zFactor = 100 * CInt(Application.Width / Me.Width)
Me.Width = Application.Width
Me.Height = Application.Height
End Sub