Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27350

Help using progress bar

$
0
0
Hi, i want to make a button add +10 to the progress bar every 1 second until it reaches 50.
I have added a timer with 1000 interval.
My problem is, that when i click the button, the progress bar goes to 50 instantly. It does not add 10 every second like i want it to.
Here is my code:
Code:

Public Class Form1
 
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Do Until ProgressBar1.Value = 50
            ProgressBar1.Value = ProgressBar1.Value + 10
        Loop

    End Sub
End Class

Thanks for any help.

EDIT: I took off the do until loop, and it worked fine. It kept adding +10. I just want it to stop at 50.

Viewing all articles
Browse latest Browse all 27350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>