maximize the MDI child

  • Thread starter Thread starter Jassim Rahma
  • Start date Start date
J

Jassim Rahma

how can I maximize the MDI child in the free MDI parent area not in the
whole window.. I mean in the (whole window area - menubar - tool bar) so i
want the MDi child to show its whole window and caption bar within the MDI
container.
 
Jassim said:
how can I maximize the MDI child in the free MDI parent area not in the
whole window.. I mean in the (whole window area - menubar - tool bar) so
i want the MDi child to show its whole window and caption bar within the
MDI container.

I don't know that you can. The general point of the maximize behavior
for an MDI child is that the caption bar gets merged with the menu of
the parent window.

However, you could simulate the behavior by checking the WindowState in
the OnResize method of your child form, and if it's Maximized, manually
reset the WindowsState to Normal and adjust the window size and position
to fit where you want it.

I played with this a little, and found that by insetting the parent's
ClientRectangle 5 pixels in width and height, that accounted for the
internal frame you get when a form is an MdiContainer. There might be a
direct way to get these metrics, but if there is I don't know.

For that matter, I haven't done any MDI stuff other than to fiddle
around with it, so I suppose there's a better, more-approved way to
avoid the merging behavior. But if there is, I don't see it.

Pete
 
You could set the WindowState of the MDI child to FormWindowState.Maximized
when the form loads or when the user presses a button for example. Another
thing you could also do is set the Dock property of the MDI child to
DockStyle.Fill, again depending on what you want to do.

Adrian.
 
docking worked...

thank you very much..


Adrian Voicu said:
You could set the WindowState of the MDI child to
FormWindowState.Maximized
when the form loads or when the user presses a button for example. Another
thing you could also do is set the Dock property of the MDI child to
DockStyle.Fill, again depending on what you want to do.

Adrian.
--
[Please mark my answer if it was helpful to you]




Jassim Rahma said:
how can I maximize the MDI child in the free MDI parent area not in the
whole window.. I mean in the (whole window area - menubar - tool bar) so
i
want the MDi child to show its whole window and caption bar within the
MDI
container.
 
how can i make sure the MDI child will be docked when the user clicked on
the maximize button without it's being maximized first!! I tried this but
didn't work.

private void TerminalForm_ResizeBegin(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Maximized)
{
this.Dock = DockStyle.Fill;
}
}



Adrian Voicu said:
You could set the WindowState of the MDI child to
FormWindowState.Maximized
when the form loads or when the user presses a button for example. Another
thing you could also do is set the Dock property of the MDI child to
DockStyle.Fill, again depending on what you want to do.

Adrian.
--
[Please mark my answer if it was helpful to you]




Jassim Rahma said:
how can I maximize the MDI child in the free MDI parent area not in the
whole window.. I mean in the (whole window area - menubar - tool bar) so
i
want the MDi child to show its whole window and caption bar within the
MDI
container.
 
Back
Top