I am working with an MDI application.
I have three forms where in Form1 is MDIParent form.From this MDIParent form
another form FOrm2 is getting open which remains within the bounds if mdiparent
window.Form2 has a button, when clicked opens Form3 which I want it to get
open as child of MDIParent form(Form1).it does not remain within the bounds of
mdiparent form.How do I do this.
Form2 has a code:
Button1_Click ()
{
Form3 f3=new Form3();
f3.MDIParent=Form1;//error here
f3.show();
}

Recommended Answers

Try

f3.MdiParent=Form1.MdiParent;
Jump to Post

All 2 Replies

Try

f3.MdiParent=Form1.MdiParent;

Try this,

Form3 frm = new Form3();
            frm.MdiParent = this;
            this.ActivateMdiChild(frm);         
            frm.Show();

Hope this will help you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.