Private Sub UserForm_Initialize()
Dim oldSize
Larg0 = Me.Width: Haut0 = Me.Height
Me.Left = (Application.Width - Larg0) / 2
Me.Top = (Application.Height - Haut0) / 4
Top0 = Me.Top: Left0 = Me.Left
LargIni = Me.Width: HautIni = Me.Height
Me.Top = 0: Me.Left = 0
oldSize = Application.WindowState
Application.WindowState = xlMaximized
Me.Move 0, 0, Application.Width, Application.Height
LargMax = Me.Width: HautMax = Me.Height
Application.WindowState = oldSize
Me.Move Left0, Top0, Larg0, Haut0
' réactiver la ligne suivante pour passage plein écran à l'ouverture de userform1
' Me.Move LargMax * (1 - 0.95) / 2, HautMax * (1 - 0.95) / 2, LargMax * 0.95, HautMax * 0.95
End Sub
Private Sub UserForm_Resize()
Dim Ctrl As Control, ratioLarg, ratioHaut
LargAct = Me.Width: ratioLarg = LargAct / LargIni
HautAct = Me.Height: ratioHaut = HautAct / HautIni
On Error Resume Next
For Each Ctrl In Me.Controls
Ctrl.Top = Ctrl.Top * ratioHaut
Ctrl.Height = Ctrl.Height * ratioHaut
Ctrl.Left = Ctrl.Left * ratioLarg
Ctrl.Width = Ctrl.Width * ratioLarg
Ctrl.Font.Size = TailPolice0 * (LargAct / Larg0)
Next Ctrl
On Error GoTo 0
LargIni = Me.Width
HautIni = Me.Height
End Sub