Please try to understand my need.
I have a project it has 3 froms.
Form1 is - MDI Parent
Form2 is - MDI Child
Form3 is - MDI child
I have already open the Form2 inside Form1(The parent form).
Form2 has a button.if clicked i want to open From3 inside the parent form(in my case it is Form1)
I already use the
Form2 form2 = new Form2();
from2.Mdiparent = this;
form2.show();
but i cant use the same code to open Form3 in the parent form(The parent form is Form1) because now i'm on the form2 so i can't use the key " this " am i correct?
please help me on this please.
Loading
VulpesPosted May 21, 2011, 6:25 AM
Form3 f3 = new Form3();
f3.MdiParent = this.MdiParent; // 'this' refers to the current instance of Form2 and so Form3 will share the same parent, namely Form1
f3.Show();
Vilas GitePosted May 21, 2011, 10:45 AM
The moto is that post became closed. :)
Rudi SteelmanPosted May 21, 2011, 10:05 AM
Vilas GitePosted May 21, 2011, 6:32 AM
Are you want two forms will activated in a single button click?then its possible.
please ensure your MDI parent forms properties check it-IsMdiContainer=true;
private void button1_Click(object sender, EventArgs e)
{
Form2 frm2 = new Form2();
frm2.MdiParent = this;
frm2.Show();
Form3 frm3 = new Form3();
frm3.MdiParent = this;
frm3.Show();
}
-------------------------------------------------------------------
Checked Answer Box if, you solve your post........
Rudi SteelmanPosted May 21, 2011, 6:31 AM
i'll check this and reply to u
Suthish NairPosted May 21, 2011, 6:28 AM