ProgressBar
ProgressBar
ProgressBar
ProgressBar
Class
Definition
Represents a control that indicates the progress of an operation, where the typical visual appearance is a bar that animates a filled area as progress continues.
public : class ProgressBar : RangeBase, IProgressBarpublic class ProgressBar : RangeBase, IProgressBarPublic Class ProgressBar Inherits RangeBase Implements IProgressBar// This API is not available in Javascript.
<ProgressBar .../>
- Inheritance
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited properties
Inherited events
Inherited methods
Examples
The following example demonstrates a value-based ProgressBar and an indeterminate ProgressBar.
<StackPanel x:Name="LayoutRoot">
<StackPanel BorderBrush="Black" BorderThickness="4" Padding="12">
<TextBlock Text="Value-Based Progress Bar"/>
<ProgressBar x:Name="progressBar1" Value="0" Maximum="200" Margin="0,12"/>
<RepeatButton Content="Press and hold" Click="RepeatButton_Click"/>
</StackPanel>
<StackPanel BorderThickness="4" BorderBrush="Black" Padding="12">
<TextBlock Text="Indeterminate Progress Bar"/>
<ProgressBar IsIndeterminate="True" Margin="0,12"/>
</StackPanel>
</StackPanel>
private static int _clicks = 0;
private void RepeatButton_Click(object sender, RoutedEventArgs e)
{
_clicks += 1;
progressBar1.Value = _clicks;
if (_clicks >= progressBar1.Maximum) _clicks = 0;
}
Remarks
A ProgressBar control visually indicates progress of an operation with one of two styles: a bar that displays a repeating pattern, or a bar that fills based on a value.


The IsIndeterminate property determines the appearance of a ProgressBar.
- Set IsIndeterminate to true to display a repeating pattern. An alternative control to use for indeterminate progress is a ProgressRing.
- Set IsIndeterminate to false to fill the bar based on a value. When IsIndeterminate is false, you specify the range with the Minimum and Maximum properties. By default Minimum is 0 and Maximum is 1. To specify the progress value, you set the Value property.
Notes for Windows 8.x
Windows 8.x In an app compiled for Windows 8, when the ProgressBar is indeterminate, the progress animation continues even if it's not visible on the screen, such as when the ProgressBar Visibility is Collapsed. This can keep the UI thread awake, use resources, and impair app performance. When the ProgressBar is not visible, you should disable the animation by setting IsIndeterminate to false.
Constructors
ProgressBar() ProgressBar() ProgressBar() ProgressBar()
Initializes a new instance of the ProgressBar class.
public : ProgressBar()public ProgressBar()Public Sub New()// This API is not available in Javascript.
Properties
IsIndeterminate IsIndeterminate IsIndeterminate IsIndeterminate
Gets or sets a value that indicates whether the progress bar reports generic progress with a repeating pattern or reports progress based on the Value property.
public : PlatForm::Boolean IsIndeterminate { get; set; }public bool IsIndeterminate { get; set; }Public ReadWrite Property IsIndeterminate As bool// This API is not available in Javascript.
<ProgressBar IsIndeterminate="bool"/>
- Value
- PlatForm::Boolean bool bool bool
True if the progress bar reports generic progress with a repeating pattern; false if the progress bar reports progress based on the Value property. The default is false.
Remarks
Notes for Windows 8.x
Windows 8.x In an app compiled for Windows 8, when the ProgressBar is indeterminate, the progress animation continues even if it's not visible on the screen, such as when the ProgressBar Visibility is collapsed. This can keep the UI thread awake, use resources, and impair app performance. When the ProgressBar is not visible, you should disable the animation by setting IsIndeterminate to false.
IsIndeterminateProperty IsIndeterminateProperty IsIndeterminateProperty IsIndeterminateProperty
Identifies the IsIndeterminate dependency property.
public : static DependencyProperty IsIndeterminateProperty { get; }public static DependencyProperty IsIndeterminateProperty { get; }Public Static ReadOnly Property IsIndeterminateProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the IsIndeterminate dependency property.
ShowError ShowError ShowError ShowError
Gets or sets a value that indicates whether the progress bar should use visual states that communicate an Error state to the user.
public : PlatForm::Boolean ShowError { get; set; }public bool ShowError { get; set; }Public ReadWrite Property ShowError As bool// This API is not available in Javascript.
<ProgressBar ShowError="bool"/>
- Value
- PlatForm::Boolean bool bool bool
True if the progress bar should use visual states that communicate an Error state to the user; otherwise, false. The default is false.
ShowErrorProperty ShowErrorProperty ShowErrorProperty ShowErrorProperty
Identifies the ShowError dependency property.
public : static DependencyProperty ShowErrorProperty { get; }public static DependencyProperty ShowErrorProperty { get; }Public Static ReadOnly Property ShowErrorProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the ShowError dependency property.
ShowPaused ShowPaused ShowPaused ShowPaused
Gets or sets a value that indicates whether the progress bar should use visual states that communicate a Paused state to the user.
public : PlatForm::Boolean ShowPaused { get; set; }public bool ShowPaused { get; set; }Public ReadWrite Property ShowPaused As bool// This API is not available in Javascript.
<ProgressBar ShowPaused="bool"/>
- Value
- PlatForm::Boolean bool bool bool
True if the progress bar should use visual states that communicate a Paused state to the user; otherwise, false. The default is false.
ShowPausedProperty ShowPausedProperty ShowPausedProperty ShowPausedProperty
Identifies the ShowPaused dependency property.
public : static DependencyProperty ShowPausedProperty { get; }public static DependencyProperty ShowPausedProperty { get; }Public Static ReadOnly Property ShowPausedProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the ShowPaused dependency property.
TemplateSettings TemplateSettings TemplateSettings TemplateSettings
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining templates for a ProgressBar control.
public : ProgressBarTemplateSettings TemplateSettings { get; }public ProgressBarTemplateSettings TemplateSettings { get; }Public ReadOnly Property TemplateSettings As ProgressBarTemplateSettings// This API is not available in Javascript.
- Value
- ProgressBarTemplateSettings ProgressBarTemplateSettings ProgressBarTemplateSettings ProgressBarTemplateSettings
An object that provides calculated values for templates.