Resizing an MDI Child Form to Fit its Parent

Here’s a useful snippet for resizing an MDI child form to fit its parent, minus the title bar, menu bar, status bar and so on:

foreach (Control ctrl in MdiParent.Controls)

{

    if (ctrl is MdiClient)

    {

        Width = ctrl.ClientSize.Width;

        Height = ctrl.ClientSize.Height;

        break;

    }

}

2 Responses to “Resizing an MDI Child Form to Fit its Parent”

  1. swfdw Says:

    hello, good site.


Leave a Reply