Sub reformUF()
Dim H&, WW&, HH&, Ctrl, wstate, coeffH#, coeffW#, coeffFont, cw, I&, hwnd&
HH = Me.InsideHeight: WW = Me.InsideWidth: wstate = Application.WindowState
hwnd = ExecuteExcel4Macro("CALL(""user32"",""GetActiveWindow"",""JCC"")") 'api GetActiveWindow Capture du handle de la fenetre active
ExecuteExcel4Macro ("CALL(""user32"",""SetWindowLongA"",""JJJJJ""," & hwnd & ", " & -16 & ", " & &H94080080 & ")") 'api SetWindowLongA
ExecuteExcel4Macro ("CALL(""user32"",""DrawMenuBar"",""JJJJJJ"", " & hwnd & ")")
ExecuteExcel4Macro ("CALL(""user32"",""ShowWindow"",""JJJ"",""" & hwnd & """,""" & 3 & """)") ' application du mode
coeffH = Me.InsideHeight / HH: coeffW = Me.InsideWidth / WW
coeffFont = Application.Min(coeffW, coeffH)
For Each Ctrl In Me.Controls
Ctrl.Move Ctrl.Left * coeffW, Ctrl.Top * coeffH, Ctrl.Width * coeffW, Ctrl.Height * coeffH
On Error Resume Next
Ctrl.Font.Size = (Ctrl.Font.Size * coeffFont) - 1
Err.Clear
If TypeOf Ctrl Is ListBox Then
cw = Split(Ctrl.ColumnWidth, ";")
For I = 0 To UBound(cw): cw(I) = cw(I) * coeffW: Next
Ctrl.ColumnWidth = Join(cw, ";")
End If
Next
End Sub