Bonjour

Voilà, a louverture de mon dossier excel j'arrive directement sur un userform qui s'agrandit et qui prend tout l'écran avec ce code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
rivate Sub UserForm_Initialize()
  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
  'Dim hwnd As Long
  hwnd = FindWindowA("Thunder" & IIf(Application.Version Like "8*", "X", "D") & "Frame", Me.Caption)
  SetWindowLongA hwnd, -16, GetWindowLongA(hwnd, -16) And &HFFF7FFFF
 
End Sub
Il y a 3 command button dessus et un Label, comment puis je faire afin que mes commandes se retrouve centrée sur l'écran et peu un porte la taille de l'écran ??

Merci