Click here to Skip to main content
15,898,374 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i have MDI and child form ,But child form does not open inside MDI container in C#.

For MDI form i have set IsmdiContainer : True

For child form i have set IsmdiContainer : False

What I have tried:

private void MnuCalculator_Click(object sender, EventArgs e)
        {
          FrmCalculator child = new FrmCalculator();
            child.MdiParent = this.MdiParent; 
            child.Show();
            
        }
Posted
Updated 12-Mar-20 10:48am

1 solution

You set the MdiParent of the child to the MdiParent of the parent. Your child.MdiParent should just be:
C#
private void MnuCalculator_Click(object sender, EventArgs e)
{
    FrmCalculator child = new FrmCalculator();
    child.MdiParent = this;
    child.Show();
}

Why are you even using MDI to begin with? It's been a dead technology for at least a decade.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900