Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Silverlight
Silverlight 2
ProgressBar Class

  Switch on low bandwidth view
Other versions are also available for the following:
.NET Framework Class Library for Silverlight
ProgressBar Class

Updated: February 2009

Represents a control that indicates the progress of an operation.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
Visual Basic (Declaration)
<TemplatePartAttribute(Name := "ProgressBarTrack", Type := GetType(FrameworkElement))> _
<TemplateVisualStateAttribute(Name := "Determinate", GroupName := "CommonStates")> _
<TemplateVisualStateAttribute(Name := "Indeterminate", GroupName := "CommonStates")> _
<TemplatePartAttribute(Name := "ProgressBarIndicator", Type := GetType(FrameworkElement))> _
Public Class ProgressBar _
    Inherits RangeBase
Visual Basic (Usage)
Dim instance As ProgressBar
C#
[TemplatePartAttribute(Name = "ProgressBarTrack", Type = typeof(FrameworkElement))]
[TemplateVisualStateAttribute(Name = "Determinate", GroupName = "CommonStates")]
[TemplateVisualStateAttribute(Name = "Indeterminate", GroupName = "CommonStates")]
[TemplatePartAttribute(Name = "ProgressBarIndicator", Type = typeof(FrameworkElement))]
public class ProgressBar : RangeBase
XAML Object Element Usage
<ProgressBar .../>

A ProgressBar control visually indicates progress of a lengthy operation with one of two styles.

  • A bar that displays a repeating pattern.

  • A bar that fills based on a value.

The following illustration shows a progress bar indicating value-based progress.

ProgressBar Control

Silverlight Progress Bar Control

The following example demonstrates a value-based ProgressBar and an indeterminate ProgressBar.

<StackPanel x:Name="LayoutRoot" Background="White">
   <Border BorderThickness="5" BorderBrush="Black">
    <StackPanel Background="LightGray">
        <TextBlock HorizontalAlignment="Center" Margin="10" 
            Text="Value-Based Progress Bar" />
        <ProgressBar x:Name="pg1" Value="100"  Margin="10" Maximum="200" 
            Height="15" IsIndeterminate="False" />
    </StackPanel>
</Border>
    <Border BorderThickness="5" BorderBrush="Black">
        <StackPanel Background="LightGray">
            <TextBlock HorizontalAlignment="Center" 
                Margin="10" Text="Indeterminate Progress Bar" />
            <ProgressBar x:Name="pg2" Margin="10" Height="15" 
                IsIndeterminate="True"   />
        </StackPanel>
    </Border>
</StackPanel>

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Date

History

Reason

February 2009

Fixed broken link.

Customer feedback.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker