This documentation is archived and is not being maintained.

StatusStrip Class

Represents a Windows status bar control.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

'Declaration
<ComVisibleAttribute(True)> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
Public Class StatusStrip _
	Inherits ToolStrip
'Usage
Dim instance As StatusStrip

StatusStrip replaces the StatusBar control. Special features of StatusStrip include a custom table layout, support for the form's sizing and moving grips, and support for the Spring property, which allows a ToolStripStatusLabel to fill available space automatically.

The following items are specifically designed to work seamlessly with both ToolStripSystemRenderer and ToolStripProfessionalRenderer in all orientations. They are available by default at design time for the StatusStrip control:

A StatusStrip control displays information about an object being viewed on a Form, the object's components, or contextual information that relates to that object's operation within your application. Typically, a StatusStrip control consists of ToolStripStatusLabel objects, each of which displays text, an icon, or both. The StatusStrip can also contain ToolStripDropDownButton, ToolStripSplitButton, and ToolStripProgressBar controls.

The default StatusStrip has no panels. To add panels to a StatusStrip, use the ToolStripItemCollection.AddRange method, or use the StatusStrip Items Collection Editor at design time to add, remove, or reorder items and modify properties. Use the StatusStrip Tasks Dialog Box at design time to run common commands.

Although StatusStrip replaces and extends the StatusBar control of previous versions, StatusBar is retained for both backward compatibility and future use if you choose.

The following code example demonstrates a StatusStrip with various common properties set.

Imports System
Imports System.Text
Imports System.Windows.Forms

Public Class Form1
   Inherits Form
   Private statusStrip1 As StatusStrip
   Private toolStripStatusLabel1 As ToolStripStatusLabel

   Public Sub New()
      InitializeComponent()
   End Sub

   <STAThread()>  _
   Shared Sub Main()
      Application.EnableVisualStyles()
      Application.Run(New Form1())
   End Sub 

   Private Sub InitializeComponent()
      statusStrip1 = New System.Windows.Forms.StatusStrip()
      toolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel()
      statusStrip1.SuspendLayout()
      SuspendLayout()
      '  
      ' The following code example demonstrates the syntax for setting 
      ' various StatusStrip properties.
      statusStrip1.Dock = System.Windows.Forms.DockStyle.Top
      statusStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Visible
      statusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {toolStripStatusLabel1})
      statusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow
      statusStrip1.Location = New System.Drawing.Point(0, 0)
      statusStrip1.Name = "statusStrip1"
      statusStrip1.ShowItemToolTips = True
      statusStrip1.Size = New System.Drawing.Size(292, 22)
      statusStrip1.SizingGrip = False
      statusStrip1.Stretch = False
      statusStrip1.TabIndex = 0
      statusStrip1.Text = "statusStrip1" 
      '  
      ' toolStripStatusLabel1 
      ' 
      toolStripStatusLabel1.Name = "toolStripStatusLabel1"
      toolStripStatusLabel1.Size = New System.Drawing.Size(109, 17)
      toolStripStatusLabel1.Text = "toolStripStatusLabel1" 
      '  
      ' Form1 
      ' 
      ClientSize = New System.Drawing.Size(292, 273)
      Controls.Add(statusStrip1)
      Name = "Form1"
      statusStrip1.ResumeLayout(False)
      statusStrip1.PerformLayout()
      ResumeLayout(False)
      PerformLayout()
   End Sub  
End Class

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 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: