Maximizing child mdi in a limited area

I have a form that is an md container and has a menu bar at the top. I add a child form to my mdi container, and when I maximize the child, it maximizes over menustrip. I want to know how to limit a child to a maximum value below menustrip. Any help would be appreciated.

+3
source share
3 answers

Your child form is maximized as expected that child forms should be maximized in MDI. This does not really cover the menu bar of the parent form — it actually combines its own menu bar with the form of the parent form.

MDI ( ), - . :

if (this.WindowState == FormWindowState.Maximized)
{
    this.WindowState = FormWindowState.Normal;
    this.Size = this.MdiParent.ClientSize;
    this.Location = new Point(0, 0);
}

.

"- ", . ClientSize , MDI. , , , -, -. . :

/ MDI Winforms

+2

MaximumSize , .

0

, , , , , . Dock DockStyle.Fill , .

, , , DockStyle.

, MDI , , DockStyle , FormBorderStlye FixedDialog ( ) .

, " ", WndProc (SC_MOVE) , .

0

Source: https://habr.com/ru/post/1720736/


All Articles