Search code examples
c#formsmdi

Child Form Size Set to the MDI Form's MDI Container's Size


I'd like to know how I can have a child form load up with it's size covering the complete MDI Parent's MDI container space (the dark-gray thing)? Setting the child form's WindowState to Maximized is not an option as it'll maximize any other form too. Suggestions?


Solution

  • I think this code should do it:

    Form childForm = new Form();
    f.Left = 0;
    f.Top = 0;
    f.Size = ParentForm.ClientRectangle.Size;