1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
Private Sub UserForm_Initialize()
With LblFond
.Top = 10
.Left = 0
.Width = Me.Width
.Height = 15
.BorderStyle = fmBorderStyleSingle
End With
With LblProgress
.Top = 10
.Left = 0
.Width = 0
.Height = 15
.BackColor = &H8000&
.ForeColor = &HFFFFFF
End With
End Sub
Private Sub UserForm_Click()
Dim i As Long
For i = 1 To 100000
Progression i, 100000
DoEvents
Next i
End Sub
Sub Progression(ByVal Valeur As Double, _
ByVal Maxi As Double)
Dim R As Double
R = LblFond.Width / Maxi
LblProgress.Width = Valeur * R
LblProgress.Caption = Valeur
If Valeur = Maxi Then LblProgress.Width = 0
End Sub |