Hey,
im trying to make a Mdi form with a toolbar,
and if a new subform is opened, there must be a button added to
A tool container, so you easly can switch from maximized screens.
Im trying an hour now and still dont get this to work.
I hope someone would like to help me :)
Thanks
Chris

Dmi forms title in toolbar!
ArisenX
HelpMePl0x
hi,
Is your problem solved
Thank you,
Bhanu.
JoshLindenmuth
this solved my problems thanks :D
Chris
dferraro
Im so sorry,
I mean Mdi,
i'll change it in the topic title
Raatjetoe
This is what I did as a sample to implement this. It is missing the removal of the form when it closes.
I added a new form to my project, added a ToolStrip control to it and set it to be a MDI container. I added method to add a childform as a button to the toolstrip. This is the code I have in Form1 (MDI form) after adding Form1_Load event handler.
public void AddChildToToolStrip(Form child){
ToolStripItem tsi = toolStrip1.Items.Add(child.Text);
tsi.Tag = child;
tsi.Click += new EventHandler(tsi_Click);
} public void tsi_Click(object sender, EventArgs e)
{
if (sender is ToolStripItem)
{
Form f = (sender as ToolStripItem).Tag as Form;
f.Activate();
}
} private void Form1_Load(object sender, EventArgs e)
{
Form1 f = new Form1();
f.Text = "one";
f.MdiParent = this;
f.Show();
f = new Form1();
f.Text = "two";
f.MdiParent = this;
f.Show();
}
In the child forms event handler for the form load event I add a call to its parent AddChildToToolStrip() method.
private void Form2_Load(object sender, EventArgs e){
if (true == this.IsMdiChild)
{
Form1 f = this.MdiParent as Form1;
f.AddChildToToolStrip(this);
}
}
This should give you an idea how to start.
Broomandan
When you open a new child form in MDI set that form's following properties:
1. ControlBox = true
2. MaximizeBox=true
3.MinimizeBox=true
4.FormBorderStyle=sizeable/sizeable tool window
Thanx