Make a status strip label that sticks to the right side of the form in C#

[status strip label]

To create a status strip label, add a StatusStrip control to the form. When you select the StatusStrip, it should display an icon with a dropdown arrow. Click the arrow and select the kind of control you want to add to the StatusStrip. This can be StatusLabel, ProgressBar, DropDownButton, and SplitButton.

I recommend that you avoid the buttons and reserve the StatusStrip for status information and not commands.

If you set a status strip label control’s Spring property to true, then that label takes up any space not used by other controls in the StatusStrip. If the status strip label is the last one in the StatusStrip, then it extends to the right edge of the StatusStrip. If you set its TextAlign property to MiddleRight, then the label places its text at the right edge of the StatusStrip.

Note that you can place controls both to the left and right of a label with Spring = true. In that case the label with Spring = true will take up whatever space is available.

You can also set Spring = true on more than one status strip label to make them share the available space.

The final point of interest in this example is the “Normal label” on the StatusStrip control’s left side. That label’s BorderSides property is set to All and its BorderStyle property is set to Sunken so it appears sunken below the surface of the form.

Download Example   Follow me on Twitter   RSS feed   Donate

This entry was posted in controls, user interface and tagged , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.