Option Explicit
Private strURL As String
Private intProgressBarMax As Integer
Private Sub Command1_Click()
' Show the ProgressBar and enable the timer.
ProgressBar1.Visible = True
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Command1.Caption = "Show Progress"
intProgressBarMax = 50
' Configure the ProgressBar control.
ConfigureBar ProgressBar1
' Configure Timer control.
With Timer1
.Enabled = False
.Interval = 100
End With
End Sub
Private Sub Timer1_Timer()
' Test the variable named counter. If it's less
' then the module variable intProgressBarMax then
' show the ProgressBar control.
Static counter As Integer
If counter = intProgressBarMax Then
Timer1.Enabled = False
counter = 0
' hide progressbar
ProgressBar1.Visible = False
Exit Sub
Else
counter = counter + 1
ProgressBar1.Value = counter
End If
End Sub
Private Sub ConfigureBar(prgBar As ProgressBar)
With ProgressBar1
.Max = intProgressBarMax
.Visible = False
End With
End Sub