70-526 MCTSStatusStrip controlThe StatusStrip control can be seen at the bottom of many applications, such as Internet Explorer or C# Express Edition. It allows information about objects within the application to be displayed to the user. The StatusStrip control is a container for other controls, and it is one of these controls that allows text to be displayed just like a label. This is the ToolStripStatusLabel control and is shown here in its default state. ![]() Inheritance hierarchy of StatusStripSystem.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollableControl
System.Windows.Forms.ToolStrip
System.Windows.Forms.StatusStrip
Inheritance hierarchy of ToolStripStatusLabelSystem.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.ToolStripItem
System.Windows.Forms.ToolStripLabel
System.Windows.Forms.ToolStripStatusLabel
Useful properties of ToolStripStatusLabel
More properties can be seen when using a ToolStripStatusLabel as a web link. StatusStrip Items Collection EditorThe StatusStrip Items Collection Editor is used to add, remove, and reorder ToolStripItem controls located in a StatusStrip and view and set StatusStrip and ToolStripItem properties. Display the StatusStrip Items Collection Editor by: on a StatusStrip
control in the designer and choosing Edit Items from the StatusStrip Tasks dialog box.
![]() Add a ToolStripStatusLabel to a Form manuallyThe following example shows how to add a ToolStripStatusLabel to a Form. public void CreateMyToolStripStatusLabel()
{
StatusStrip statusStrip1 = new StatusStrip();
ToolStripStatusLabel toolStripStatusLabel1 = new ToolStripStatusLabel();
//
// statusStrip1
//
statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[]{
toolStripStatusLabel1});
statusStrip1.Location = new System.Drawing.Point(0, 248);
statusStrip1.Name = "statusStrip1";
statusStrip1.Size = new System.Drawing.Size(292, 25);
statusStrip1.TabIndex = 0;
statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabel1
//
toolStripStatusLabel1.Name = "toolStripStatusLabel1";
toolStripStatusLabel1.Size = new System.Drawing.Size(246, 20);
toolStripStatusLabel1.Spring = true;
toolStripStatusLabel1.Text = "toolStripStatusLabel1";
toolStripStatusLabel1.Alignment = ToolStripItemAlignment.Left;
this.toolStripLabel1.IsLink = true;
Controls.Add(statusStrip1);
}
MSDN references
|