This is for C# and I am working in a Windows 7 environment with Visual Studio Express 2010. I have an application where I have a toolstripcontainer dock set to fill so users can add toolstrips on any edge. The problem was that the toolstripcontainer has covered the that I want to use for holding sub-windows. The primary form containing the toolstripcontainer has been set as an mdi parent. I found this article useful in getting the sub-windows into the container: How to uses a ToolStripContainer whith Dock=Fill on a MDI parent?
However, sub-windows done in this way don't seem to behave as they should in the 'native' MDI environment. The boarders look as though the windows 7 Aero effect has been disabled and minimising the sub-window makes it disappear entirely.
Essentially I want an MDI area for sub-windows surrounded by toolstrip docking areas.
Thanks a lot for your help
Unfortunately, the ToolStripContainer control was not meant to work with an MDI form.
Try using the ToolStripPanel control instead. It doesn't work too well in the designer (which is probably why it isn't in the ToolBox by default).
Example:
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
this.IsMdiContainer = true;
ToolStripPanel leftPanel = new ToolStripPanel() { Dock = DockStyle.Left };
ToolStripPanel topPanel = new ToolStripPanel() { Dock = DockStyle.Top };
this.Controls.Add(leftPanel);
this.Controls.Add(topPanel);
ToolStrip ts = new ToolStrip() { Dock = DockStyle.Fill };
ToolStripButton tsb = new ToolStripButton("Test", SystemIcons.Application.ToBitmap());
ts.Items.Add(tsb);
topPanel.Controls.Add(ts);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With