troubleshooting Question progressbar with timer1 in visual studio win app

Avatar of PeterBaileyUk
PeterBaileyUk asked on
Visual Basic.NETMicrosoft Visual Studio
11 Comments2 Solutions694 ViewsLast Modified:
I would like to make my progressbar move forward every second, when it reaches the bar width then goes back to the beginning and keeps doing that until the timer is stopped. its more of a working indication as I am starting and stopping in on a sql usp call that takes about 4 minutes. currently the bar does not show any progress

    Private Sub Panel1_Click(sender As Object, e As EventArgs) Handles Panel1.Click
        MessageBox.Show("Short Strings will be created, click to continue, this process. its 1 sql event which takes about 4 minutes, so wait for the next message as progress bar wont update with this procedure call. after clicking ok")
        Me.Timer1.Enabled = True
        Me.Timer1.Interval = 1 * 1000
        Call CreateAllStrs()
        MessageBox.Show("Short Strings Created")
        Me.Timer1.Enabled = False
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        If ProgressBar2.Value <= 10000 Then
            ProgressBar2.Value = ProgressBar2.Value + 1
            ProgressBar2.Value = 1

        End If
    End Sub
Join our community to see this answer!
Unlock 2 Answers and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros