Click here to Skip to main content
15,891,725 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Can anyone please help in how to prevent merging of title bar of child form with tool strip of main form when the child form is maximized in MDI application in c#
.
Thanks
Posted
Comments
Stephen Hewison 20-May-14 8:57am    
The whole purpose of MDI is to dock the child window. But I think, there's an OnMaximize event you can use to override the behaviour and instead set the window position to 0, 0 and the width/height to the container viewport size. This will in effect maximize the window to the parent without actually maximizing the window.
Ziee-M 20-May-14 9:23am    
hi, first you have to set the childform WindowState to default (you may find it in the properties of the form).<br>
 <br>
Then, when instanciating a new child,<br>
 <br>
child.Dock = DockStyle.Fill;<br>
 <br>
*Optional:<br>
you have to disable the MaxemizeBox to false (child properties) so the user can't force the window to its max.<br>
 <br>
Finally, in case the child donn't automatically resize when the parent container change size, you have to write some code in the form size changed event.<br>
 <br>
I 'am not 100% sure it will work for you because i am useing a ribbon (Graphic Dll like Microsoft office, you may check it in code project articles, pretty beautiful for MDI system).<br>
Hope it helps

Link for the ribbon MDI System : http://www.codeproject.com/Articles/364272/Easily-Add-a-Ribbon-into-a-WinForms-Application-Cs

PS: using this ribbon will force you to install .Net FrameWork 4.0 full on client machine instead of .NetFrameWork 4.0 client profile. for windows 8, .NetFrameWork 4.0 full is installed by default, not the case for Windows 7.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900