Share via

Visual Basic loop

Anonymous
2024-03-01T20:05:46.7333333+00:00

Right now my current code is

Do

            ProgressBar1.Value -= 5

        Loop While ProgressBar1.Value < 100

But its too fast so it instantly makes the value negative, is there a way i can slow down this loop without a timer?

This is for Visual Basic

Developer technologies | VB

1 answer

Sort by: Most helpful
  1. Viorel 127K Reputation points
    2024-03-01T20:18:23.34+00:00

    For example:

    Do
        ProgressBar1.Value -= 5
        System.Threading.Thread.Sleep(55)
    Loop While ProgressBar1.Value >= ProgressBar1.Minimum + 5
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.