473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

maximize the MDI child

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
4 13583
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

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

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: w.p. | last post by:
I use code below: 1) frame receive too many maximize events on create and on close child window - why? 2) how to catch key events for wxMDIParentFrame ? 3) childWin.SetSize() in OnMaximize send...
3
by: Paul Welter | last post by:
I'm building a MDI application that has child forms. I'm trying to find a way to hide the inner boarder of the child frame area. Setting the FormBoarderStyle of the child form has no effect. ...
0
by: Andrew Baker | last post by:
I have a MDI parent which is to open a "Control Panel" style child when it starts. In the load event I have: Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As...
0
by: Bill | last post by:
Hi I have a parent child forms. I want the close, maximize, and minimize buttons to be removed. One the child form I have set the maximize and minimize buttons to false. I have the child form...
3
by: guy | last post by:
VB2005 I have an MDI application, which displays modal forms correctly, and starts up with the MDI form maximized however for non modal forms behavious is unusual all forms have MaximizeBox,...
1
by: neeraj | last post by:
Hi people's I developed one MDI application with one MDI form and 2 child forms, form. Border style of first child forms set as Fixed3D and Window State set as normal (like dialog Box) and...
2
by: John | last post by:
I use C# in VS 2005. In my MDI app, if I click on the title bar of a child form, the form will maximize and the title bar will disappear. I want the app to do it automatically, when launching a...
1
by: Brett Romero | last post by:
I set an MDI child form to Windowstate=maximized at design time. When I new up and show the child form in the MDI parent, the child's title is hidden since it's pushed to far up (below parent tool...
0
by: phpfreak2007 | last post by:
Hello all,,, I have created one Application. there are one MDI form and One child.. Initially i set the Window state for both of them to Maximized.. but when i display child form....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.