By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,084 Members | 1,199 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,084 IT Pros & Developers. It's quick & easy.

maximize the MDI child

P: n/a
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.

Aug 2 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Jassim Rahma wrote:
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
Aug 2 '07 #2

P: n/a

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" wrote:
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.
Aug 3 '07 #3

P: n/a

docking worked...

thank you very much..
"Adrian Voicu" <Ad*********@discussions.microsoft.comwrote in message
news:BE**********************************@microsof t.com...
>
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" wrote:
>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.
Aug 3 '07 #4

P: n/a
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" <Ad*********@discussions.microsoft.comwrote in message
news:BE**********************************@microsof t.com...
>
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" wrote:
>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.
Aug 4 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.