I have an application where there can be several lengthy (minutes) tasks happening simultaneously in the background (i.e. the same task for different accounts, some accounts tak
Probably it's not an intelligent UI design, but just for your information, you can add any control using ToolStripControlHost. Here is a simple example which lets you add multiple StatusBar
controls in a single item of StatusStrip
using code:
ToolStripControlHost host;
FlowLayoutPanel panel;
private void button1_Click(object sender, EventArgs e)
{
if (panel == null)
{
panel = new FlowLayoutPanel();
panel.FlowDirection = FlowDirection.TopDown;
panel.WrapContents = false;
panel.AutoSize = true;
panel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
}
if (host == null)
{
host = new ToolStripControlHost(panel);
this.statusStrip1.Items.Add(host);
}
panel.Controls.Add(new ProgressBar() { /* Value = new Random().Next(0, 100) */ });
}
Note: You also can extend ToolStripControlHost
to provide design-time support, to do so take a look at How to: Wrap a Windows Forms Control with ToolStripControlHost.