Dim i As Byte, CBg As Integer, CBh As Integer, Lib
Dim UFl As Integer, UFh As Integer
Private Sub CommandButton1_Click()
Select Case i
Case 0 'Réduire
i = 1
CommandButton1.Left = 2
CommandButton1.Top = 2
CommandButton1.Caption = Lib(1)
Me.Width = 4 + CommandButton1.Width
Me.Height = 28 + CommandButton1.Height
Case 1 'Agrandir
i = 0
CommandButton1.Left = CBg
CommandButton1.Top = CBh
CommandButton1.Caption = Lib(0)
Me.Width = UFl
Me.Height = UFh
End Select
End Sub
Private Sub CommandButton9_Click()
UsfCommande.Show 0
End Sub
Private Sub UserForm_Initialize()
Lib = Array("Réduire", "Agrandir")
i = 0
UFl = Me.Width: UFh = Me.Height
CBg = CommandButton1.Left: CBh = CommandButton1.Top
CommandButton1.Caption = Lib(i)
With Me
.StartUpPosition = 1
.Width = Application.Width
.Height = Application.Height
.Left = 0
.Top = 0
End With
End Sub