This site provides users with the information about vb, visual basic, vb6, create progress bar, how to create progress bar, how to use timer, example, and more.
If you think that this site is helpful, please recommend your friends to visit our site.
How to create progress bar with timer in vb?
The following is the code and steps for creating progress bar with timer in vb:
1. Add Microsoft common dialog control from Components.
2. In design mode, add Progress Bar and Timer onto your form.
3. Click on Timer and change Interval to 10.
4. If you do not want the standard progress bar, you can change it to smooth Progress Bar from Scrolling property.
5. Double click the Timer and add the following code:
--------------------------------------------------------------------------------
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 1
If ProgressBar1.Value = 50 Then
ProgressBar1.Value = ProgressBar1 + 50
End If
If ProgressBar1.Value >= ProgressBar1.Max Then
Timer1.Enabled = False
End If
End Sub
No comments:
Post a Comment