Panel in StatusStrip?

1.9k Views Asked by At

Is it possible to have a panel in a StatusStrip? MSDN is kind of saying so:

The default StatusStrip has no panels. To add panels to a StatusStrip, use the ToolStripItemCollection.AddRange method [...]

... but I can't find how.

I tried to add a Panel or a ToolStripPanel to a StatusStrip, but it is only accepting ToolStripItems. On the other hand, I tried adding a ToolStripItem to a Panel or a ToolStripPanel, but both only accepts Controls:

ToolStripPanel toolStripPanel = new ToolStripPanel();
toolStripPanel.Controls.Add(toolStripStatusLabel);   // Wrong
statusStrip.Items.AddRange(toolStripPanel);          // Wrong again
2

There are 2 best solutions below

0
On

What's interesting is that in Microsoft terms

ToolStripStatusLabel - Represents a panel in a StatusStrip control.

So their panel is really a Label. Unless that's a mistake in their documentation, what you are trying to do is impossible, as there is no Panel class that can be hosted inside StatusStrip.

0
On

You can use the ToolStripStatusLabel. In order to have the look and feel of a Panel, simply set the following properties of the ToolStripStatusLabel: BorderSides = All, BorderStyle = SunkenOuter