In WPF XAML <StatusBar /> element is used to create status bar control in WPF. As like as main menu, status bars are specialized toolbars. They support the same feature and customization mechanism but have a few differences in default settings. We can use status bar to provide information about status of our application such as line number, date time, current working control etc.
The following code snippet represents use of status bar control
<Grid>
<StatusBar Height="30" HorizontalAlignment="Left" Margin="12,276,0,0" Name="statusBar1" VerticalAlignment="Top" Width="479" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock x:Name="txtMessage" Text="Status Control Demo" Grid.Column="0" Grid.Row="0" />
<ProgressBar x:Name="progressbar1" Grid.Column="1" Grid.Row="0" Width="150" Value="50" />
<Button x:Name="btnStatusDemo" Grid.Column="3" Grid.Row="0" Width="Auto" Content="Status Control Button" />
</Grid>
</StatusBar>
In this demonstration I have taken one status bar control and grid control inside status bar control. Then I had put three controls in status bar such as <TextBlock /> control, <ProgressBar /> control and <Button /> control etc.
Output of the following code snippet is as follows
Leave Comment