CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2010
    Posts
    6

    mdi child Form question

    in my application i have main form whose mdicontainer property is true
    i open aform as its child form by typing

    Form frmchild=new Form();
    frmchild.MDIParent=this;
    frmchild.Show();

    from this form i open another form. how can i make this new form as child form of main form which is mdi container

    Form frmchild_new=new Form();
    frmchild_new.MDIParent=???????/;
    frmchild_new.Show();

    Regards,
    gfaryd

  2. #2
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Re: mdi child Form question

    try
    Code:
    frmchild_new.MDIParent = frmChild.Parent;
    
    //or if you are opening frmchild_new in frmchild
    frmchild_new.MDIParent = this.Parent;

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured