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&, ecartX&, ecartY&
ecartX = Round(Me.Width - Me.InsideWidth, 0)
ecartY = Round(Me.Height - Me.InsideHeight, 0)
With Application
Wstate = .WindowState
.WindowState = xlMaximized
W = .Width - ecartY: H = (.Height + ecartX) - ecartY: 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