Search code examples
c#winformsparent

Parent child forms - child form shrinks on maximize and restore down


I have a winform and opening other forms inside this using IsMdiContainer property. In contructor of parent I got :

    this.IsMdiContainer = true;
    this.WindowState = FormWindowState.Maximized;

then for child I got :

        child.MdiParent = this;
        child.WindowState = FormWindowState.Maximized;

for some reason if you maximize and restore down(not minimize) the child form shrinks each time. Now in child form I have a dock.fill panel and two groupboxes one docked to top and other dock to fill.

any ideas why this behaviour is happening?

Thanks


Solution

  • This shouldn't happen. Check the code for your child form and see if you can find any additional size settings.