Reputation: 18743
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 ToolStripItem
s. On the other hand, I tried adding a ToolStripItem
to a Panel
or a ToolStripPanel
, but both only accepts Control
s:
ToolStripPanel toolStripPanel = new ToolStripPanel();
toolStripPanel.Controls.Add(toolStripStatusLabel); // Wrong
statusStrip.Items.AddRange(toolStripPanel); // Wrong again
Upvotes: 0
Views: 2075
Reputation: 1
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
Upvotes: 0
Reputation: 26424
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.
Upvotes: 1