Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

StatusBar Class

Represents a control that displays items and information in a horizontal bar in an application window.

Namespace: System.Windows.Controls.Primitives
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:

[StyleTypedPropertyAttribute(Property="ItemContainerStyle", StyleTargetType=typeof(StatusBarItem))] 
public class StatusBar : ItemsControl
/** @attribute StyleTypedPropertyAttribute(Property="ItemContainerStyle", StyleTargetType=System.Windows.Controls.Primitives.StatusBarItem) */ 
public class StatusBar extends ItemsControl
StyleTypedPropertyAttribute(Property="ItemContainerStyle", StyleTargetType=System.Windows.Controls.Primitives.StatusBarItem) 
public class StatusBar extends ItemsControl

Content Model: StatusBar is an ItemsControl and has two content properties: Items and ItemsSource. For information about how to set these properties, see the Items Control Content Model overview.

A StatusBar is a bar that typically displays a horizontal row of images and status information. You can divide the items in a StatusBar into groups that contain related items, by using Separator controls. The items in a StatusBar can display text, graphics, or other complex content. Items in a StatusBar are defined as StatusBarItem objects.

Events that are defined on a StatusBarItem are raised when the user clicks the item in the StatusBar.

The StatusBar does not receive keyboard focus.

The following illustration shows an example of a StatusBar.

Status Bar

Status bar

A StatusBar is a horizontal window at the bottom of a parent window in which an application can display various kinds of status information.

The following example shows how to define a StatusBar by using Extensible Application Markup Language (XAML) and how to add a ProgressBar by using code.

<StatusBar Name="sbar" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" 
           VerticalAlignment="Bottom" Background="Beige" > 
       <Separator Style="{StaticResource StatusBarSeparatorStyle}"/>

private void MakeProgressBar(object sender, RoutedEventArgs e)
  TextBlock txtb = new TextBlock();
  txtb.Text = "Progress of download.";
  ProgressBar progressbar = new ProgressBar();
  Duration duration = new Duration(TimeSpan.FromSeconds(10));
  DoubleAnimation doubleanimation = 
                             new DoubleAnimation(100.0, duration);
  ToolTip ttprogbar = new ToolTip();
  ttprogbar.Content = "Shows the progress of a download.";
  progressbar.ToolTip = (ttprogbar);

The following example shows how to add two Image controls that are separated by a Separator control.

Image helpImage = new Image();
 helpImage.Width = 16;
 helpImage.Height = 16;
 BitmapImage bi = new BitmapImage();
 bi.UriSource = new Uri(@"pack://application:,,,/images/help.bmp");
 helpImage.Source = bi;
 ToolTip ttp = new ToolTip();
 ttp.Content = "HELP";
 helpImage.ToolTip = (ttp);

 Separator sp = new Separator();
 sp.Style = (Style)FindResource("StatusBarSeparatorStyle");
 Image printImage = new Image();
 printImage.Width = 16;
 printImage.Height = 16;
 BitmapImage bi_print = new BitmapImage();
 bi_print.UriSource = new Uri(@"pack://application:,,,/images/print.bmp");
 printImage.Source = bi_print;
 ToolTip ttp_print = new ToolTip();
 ttp.Content = "Sent to printer.";
 printImage.ToolTip = (ttp_print);

For the complete sample, see StatusBar Sample.


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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

© 2017 Microsoft