I have a timer with an interval of 1 minute and I would like to increase a progress bar in parallel with it. I’m using Winforms and C#. How can I do this ?
Help me please
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is an example of how to use the
Timercontrol with a progress bar. First, create a newTimerand aProgressBar. then, start the time when the form is loaded, using this function:Then, create an event for the tick, as shown:
Create the event’s function:
After this, add code to the tick function that adds value to the progress bar, similar to this:
Don’t forget to set a maximum value for the progress bar, which you can do by adding this code to the
form_loadfunction:Also, don’t forget to check the maximum value so your timer will stop. You can stop the timer with this code:
Full Code: