The code examples in this article demonstrates how to create a Windows app with a Progress bar control.
The <ProgressBar> element in XAML represents a Progress Bar control. The following code example creates a progresss bar in XAML.
- <ProgressBar Margin="10,10,0,13" Name="ListView1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="300" Height="30" />
The
Value property of ProgressBar sets up the current value of a ProgressBar control. In the following code, I set the Value property to 60.
- <ProgressBar Margin="10,10,0,13" Name="PBar" HorizontalAlignment="Left"
- VerticalAlignment="Top" Width="300" Height="30" Value="60" >
- </ProgressBar>
The
FlowDirection property sets the flow of the ProgressBar. You can set this value to either
LeftToRight or
RightToLeft. The default value is LeftToRight.
- FlowDirection="RightToLeft"
The following code adds a
StatusBar to WPF using XAML.
- <StatusBar Name="SBar" Grid.Column="0" Grid.Row="5" VerticalAlignment="Bottom" Background="LightBlue" >
- <StatusBarItem>
- <TextBlock>Status:</TextBlock>
- </StatusBarItem>
- </StatusBar>