I found some informations on the internet but nothing helped me out.
How can I merge a toolstrip in the parent mdi form?
Edit:
It worked for me with this code:
private void MainForm_MdiChildActivate(object sender, EventArgs e)
{
IChildWindow child = ActiveMdiChild as IChildWindow;
if (child != null)
{
ToolStripManager.Merge(child.ToolStrip, toolStrip1);
child.ToolStrip.Hide();
child.FormClosing += delegate(object sender2, FormClosingEventArgs fe)
{
child.ToolStrip.Show();
ToolStripManager.RevertMerge(toolStrip1, child.ToolStrip);
};
}
}
You need to use a
ToolStripManager. It has a method calledMerge(ToolStrip, ToolStrip)which does what you want to.See here
For example: