StatusStrip Control In C#

This article demostrates how to use Visual Studio IDE to implement a status bar in a WinForms app. To learn more about Status Bar, and its properties in detail, please refer to StatusStrip in Windows Forms.

If you've used a StatusBar control in Visual Studio .NET, you must get annoyed when you want to add a progress bar, a drop down control, or an image to the StatusBar.

StatusStrip control, available in Visual Studio, is a powerful StatusBar control with the features provided by StatusBar in previous versions. Besides status bar features, StatusStrip also provides ProgressBar, DropDownButton, SplitButton, and Label features, which means we can add a progress bar, a drop down button, a spit button, or a label control to the StatusStrip itself.

If you drag a StatusStrip control from the Toolbox to the form, you will see an option to set various actions such as StatusStripPanel, ToolStripProgressBar, ToolStripDropDownButton, and ToolStripSplitButton. See Figure 1.

StatusStrip Control
Figure 1. StatusStrip control.

You can set various Actions of StatusStrip control such as behavior, layout and appearance and also edit items from Actions dialog. See Figure 2.

Actions options of StatusStrip
Figure 2. Actions options of StatusStrip.

Edit Items link launches Item Collection Editor, where you can add Panel and ProgressBar controls to the StatusStrip control. After adding StatusStripPanel and ToolStripProgressBar controls, these controls can be managed as individual controls and you can set their properties from Item Collection Editor itself. See Figure 3.

Item Collection Editor
Figure 3. Item Collection Editor.

After adding a panel and progress bar control, StatusStrip looks like Figure 4.

StatusStrip with a panel and progress bar
Figure 4. StatusStrip with a panel and progress bar.

Now new ProgressBar control is more powerful then ever. You can even set the foreground color of it, which used to be a pain in previous versions. I set green as forecolor of ProgressBar and set its Value property to 30. Now the new layout looks like Figure 5. 

ProgressBar with green foreground
Figure 5. ProgressBar with green foreground.

Summary

Windows Forms 2.0 StatusStrip control replaces previous Windows Forms StatusBar control. The StatusStrip control is a more powerful control than StatusBar and provides many built-in features such as progress bar, status bar, dropdown button, and splitter. In this article, I discussed how to create and use StatusStrip control and its features using Visual Studio 2005 IDE.


Mindcracker
Founded in 2003, Mindcracker is the authority in custom software development and innovation. We put best practices into action. We deliver solutions based on consumer and industry analysis.