Can someone please post simple-sample(!) lines of code to make a progress bar work. I.e. fill up to 100% in a few seconds.
Thanks alot,
moonfruit :)
Printable View
Can someone please post simple-sample(!) lines of code to make a progress bar work. I.e. fill up to 100% in a few seconds.
Thanks alot,
moonfruit :)
;)Code:For a = 0 to 100
ProgressBar1.Value = A
DoEvents
Next
Don't forget to set the
ProgressBar1.Max = 100
first :)
Its 100 by default :D
You can also do this with a timer.
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 1 'increases the value by one every time
If ProgressBar1.Value >= 100 Then ProgressBar1.Value = 0 'sets the value to 0 when it gets to 100 or else it throws errors
End Sub
[Edited by MidgetsBro on 10-22-2000 at 06:27 PM]
Like Fox's example, you would usually use a ProgressBar in a Loop rather than a Timer (ie: opening a file)
Use it in a loop rather than a Timer. Works much faster and is less complicated :rolleyes:.