Option Explicit
Dim Time As Long, TimeElapsed As Long
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Time = Slider1.Value * 1000
Timer1.Interval = 100
ProgressBar1.Max = Time
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
TimeElapsed = 0
End Sub
Private Sub Timer1_Timer()
TimeElapsed = TimeElapsed + Timer1.Interval
If TimeElapsed > Time Then
Timer1.Enabled = False
ProgressBar1.Value = 0
TimeElapsed = 0
Exit Sub
End If
ProgressBar1.Value = TimeElapsed
End Sub