How do you make an indeterminate progress bar in a WinForms application? In Silverlight and WPF, you would simply set the ProgressBar's IsIndeterminate
property to true. However, this property does not exist in WinForms. How would you create an indeterminate progress bar in WinForms?
An indeterminate ProgressBar shows a cyclic animation without an indication of progress.
To create a ProgressBar control at design-time, you simply drag a ProgressBar control from the Toolbox and drop onto a Form in Visual Studio. After you the drag and drop, a ProgressBar is created on the Form; for example the ProgressBar1 is added to the form and looks as in Figure 1.
You can update the percentage of progress displayed by using the setProgress(int) method, or by calling incrementProgressBy(int) to increase the current progress completed by a specified amount. By default, the progress bar is full when the progress value reaches 100.
A progress bar is a control that an application can use to indicate the progress of a lengthy operation such as calculating a complex result, downloading a large file from the Web etc. ProgressBar controls are used whenever an operation takes more than a short period of time.
Set the Style
on the ProgressBar
to Marquee
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With