how to use progress bar in vb.net

Recommended Answers

All 3 Replies

Use a timer. drag n drop the timer n the progress bar on the form. On the top of the form code just after 'public class Form1' put 'dim i as integer = 0'. On the formload event put 'Timer1.enabled=true' Double click the timer n put this code: Progressbar1.increment(1) i += 1 if i = 100 then Timer1.enabled=false whem form loads, timer is enabled. When timer is enabled, it ticks. When it ticks the pbar is incremented with every tick up to 100.

thank uuuuuuu
it works.......

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ProgressBar1.Value < 100 Then

ProgressBar1.Value += 5

End If

End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If ProgressBar1.Value > 0 Then

ProgressBar1.Value -= 5

End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

ProgressBar1.Value = 100

End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

ProgressBar1.Value = 0

End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.