none
Problems with MDI, MDIParent and MdiChildren are empty RRS feed

  • General discussion

  • Hi,

    I have a problem with targetting parent and childs in MDI using MdiChildren and MDIParent, they are null.

    at parent form I create and add child like this:

    Child

     

    child = new Child ();

    child.MdiParent =

    this;

    toolStripContainer1.ContentPanel.Controls.Add(child);

    child.Show();

    and I access the child from parent like this:

    IEnumerable

     

    <Control> forms =

     

    from Control f in toolStripContainer1.ContentPanel.Controls

     

    where (f is Form)

     

    select f;

     

    foreach (Form item in forms)

    {

    item.Hide();

    }

    at child I can't call parent, I tried:

    this

     

    .MdiParent

    but it is null

    Any one know the reason or anothe way to access the parent?

    note:
    the Parent form contains only a toolStripContainer which I add the childs to it's ContentPanel.
    I have a label in bottomPanel and I need to write messages from child form on it.

    Sunday, October 25, 2009 4:35 AM

All replies