KingSencat
asked on
VB6.0 a test downloading file
hello
how can i make a box downloading but actually not downloading just a box with % of download i want set it to 1% - per 1 second ... 100 seconds example to finish the downloading .. actually is not a download just i would like to make an example like this
how can i make a box downloading but actually not downloading just a box with % of download i want set it to 1% - per 1 second ... 100 seconds example to finish the downloading .. actually is not a download just i would like to make an example like this
ASKER
i am newbie at vb6.0 can you explain with more details pls ?
Try this
Option Explicit
Private Sub Command1_Click()
ProgressBar1.Max = 100
ProgressBar1.Min = 0
ProgressBar1.Value = 0
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If ProgressBar1.Value = ProgressBar1.Max Then
MsgBox "Done"
Else
ProgressBar1.Value = ProgressBar1.Value + 1
End If
End Sub
Option Explicit
Private Sub Command1_Click()
ProgressBar1.Max = 100
ProgressBar1.Min = 0
ProgressBar1.Value = 0
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If ProgressBar1.Value = ProgressBar1.Max Then
MsgBox "Done"
Else
ProgressBar1.Value = ProgressBar1.Value + 1
End If
End Sub
Exactly as GrahamSkan says.
Since your new to VB, if you want to increase the speed, simply reduce the timer1.interval. This figure is in milliseconds, hence 1000ms = 1sec.
Since your new to VB, if you want to increase the speed, simply reduce the timer1.interval. This figure is in milliseconds, hence 1000ms = 1sec.
Actually, you're also relatively new to this forum, so perhaps it should be mentioned that having 19 questions open is considered excessive. Can I suggest that you attend to any that are not waiting for further information?
ASKER
Variable Not Found ..
Have you actually created a form which contains a progressbar and a timer control?
Where?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Grahamskan= Method or data number not found..
Where are you getting this error, this worked fine for me, have you added microsoft common controls to your controls list?
on a timer running every second
increase the progress bar value by 1 until it reaches 100.