Private Sub UserForm_Initialize()
Usf_resize
End Sub
Private Sub Usf_resize()
Dim ctrl As Control, RatioW#, RatioH#, Ratio_fSize, W&, T&, L&, H&, Wstate&
With Application
Wstate = .WindowState
.WindowState = xlMaximized
W = .Width: H = .Height: L = .Left: T = .Top
RatioW = W / Me.Width: RatioH = H / Me.Height
Ratio_fSize = .Min(RatioH, RatioW)
.WindowState = Wstate
End With
Me.Move L, T, W, H
For Each ctrl In Me.Controls
ctrl.Move ctrl.Left * RatioW, ctrl.Top * RatioH, ctrl.Width * RatioW, ctrl.Height * RatioH
On Error Resume Next 'tout les control msforms.... n'ont pas la membre [B]font [/B]et ses propriétés
ctrl.FontSize = ctrl.Font.Size * Ratio_fSize
Err.Clear
Next
End Sub