Opening a child form from a child form

Heh hi again.

I'm trying to open a MDIChild form from a child form, but I seem to be having trouble. How can I designate the parent by calling from a child



Answer this question

Opening a child form from a child form

  • Luc C

    At first, you must write a clear title for your question, everyone here has questions, the second thing is you must explain your problem, you didn't said what is the problem...


  • kbrouill

    heh better title ^^^^

    Anyways, I can't think of a better way to describe my problem. But, here is the code that needs helped.

    Map^ newMDIChild = gcnew Map();
    newMDIChild.MDIParent = //That's what I don't know - the current form is an MDIChild too, so I Can't put 'this'
    newMDIChild->Show();


  • Carla Nunes

    In a MDI application you should only have one MDI parent, it has the IsMdiContainer property set to true.

    You can give an owner window in the Show method of a form.
    http://msdn2.microsoft.com/en-us/library/szcefbbd.aspx

    The parent must have IsMdiContainer set to true to be used a a MDI parent.



  • JoeM

    Thanks

    Finished Code:

    Map^ newMDIChild = gcnew Map();
    newMDIChild->MDIParent = this->ParentForm;
    newMDIChild->Show();

    Works like a charm ;)


  • Opening a child form from a child form