How to create a progressBar?
-
hello, i just want to know how can i create a Progressbar that represent the progress of a specific Form. i mean, i have a Form with a lot of steps..that caculate a lot of things. while wating that this progress will finish, i want to see the progress in the progressBar.. How can i do it? thank you
Add the progress bar component to the form that you want to show it on. Set the maximum value to the number of steps you need to perform, and increment the value by 1 after each step completes.
Deja View - the feeling that you've seen this post before.
-
hello, i just want to know how can i create a Progressbar that represent the progress of a specific Form. i mean, i have a Form with a lot of steps..that caculate a lot of things. while wating that this progress will finish, i want to see the progress in the progressBar.. How can i do it? thank you
Put a ProgressBar on the form and modify the Value property according to the progress that it is being made. You'll have to calculate that as a percentage yourself. (assuming that you show it like x %)
-
Add the progress bar component to the form that you want to show it on. Set the maximum value to the number of steps you need to perform, and increment the value by 1 after each step completes.
Deja View - the feeling that you've seen this post before.
-
Admin887 wrote:
DO you have any link that shows to me how to do it?
Really. Do I need to put a link on here for you? Why don't you try it out for yourself, as this is the best way to learn?
Deja View - the feeling that you've seen this post before.
-
Add the progress bar component to the form that you want to show it on. Set the maximum value to the number of steps you need to perform, and increment the value by 1 after each step completes.
Deja View - the feeling that you've seen this post before.
-
-
Put a ProgressBar on the form and modify the Value property according to the progress that it is being made. You'll have to calculate that as a percentage yourself. (assuming that you show it like x %)
FYI you can set the maximum value so you don't need to calculate percentages. If you have 5 steps, set the Maximum to 5 and increment the value by 1.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
hello, i just want to know how can i create a Progressbar that represent the progress of a specific Form. i mean, i have a Form with a lot of steps..that caculate a lot of things. while wating that this progress will finish, i want to see the progress in the progressBar.. How can i do it? thank you
If you have to do heavy calculation. A Better idea is to do it 'a part' in another thread. Use thread safe methods to update your progress bar
-
If you have to do heavy calculation. A Better idea is to do it 'a part' in another thread. Use thread safe methods to update your progress bar
-
you can use
BackGroundWorker
For that. becuase if you used progress bar for heavy operation your GUI will not respond becuase it give the priority to operation not GUI so your progress bar will not refresh. useBackGroundWorker Components in C#
. that will help you.cheers, Abhijit
-
FYI you can set the maximum value so you don't need to calculate percentages. If you have 5 steps, set the Maximum to 5 and increment the value by 1.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview ArchiveYou can calculate a percentage for textual output in addition to a progress bar (I think that's what blackjack meant) by dividing two doubles... of course you should know how to compute a percentage. Then you can use string functions to round that to a certain number of decimal points, but alas, I don't know the exact syntax.
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-
-
If you have to do heavy calculation. A Better idea is to do it 'a part' in another thread. Use thread safe methods to update your progress bar
I second that. Threads are always best for long-running background operations, just remember to perform control updates on the control thread, as lisan mentioned. Using threads will also allow you to have a "Cancel" button that can abort the background operation (if you periodically check for a canceled state in that thread, since actually aborting threads can be dangerous).
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-
-
You can calculate a percentage for textual output in addition to a progress bar (I think that's what blackjack meant) by dividing two doubles... of course you should know how to compute a percentage. Then you can use string functions to round that to a certain number of decimal points, but alas, I don't know the exact syntax.
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-
thanks for your reply, but I fail to see that it could be useful for me ;-)
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
thanks for your reply, but I fail to see that it could be useful for me ;-)
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview ArchiveWell often a textual percentage is displayed on the progress dialog as well, or in its title bar so it can be seen on the task bar.
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-
-
you can use
BackGroundWorker
For that. becuase if you used progress bar for heavy operation your GUI will not respond becuase it give the priority to operation not GUI so your progress bar will not refresh. useBackGroundWorker Components in C#
. that will help you.cheers, Abhijit