ChildForm pops Parent Main Tool strip... Help

shanew

New member
Joined
Oct 2, 2009
Messages
3
Programming Experience
1-3
Hello,

I have MDI with a Parent form and a Child form.

The Parent has a Tool Strip and on the tool strip is a button that when clicked loads the child, this works fine.

But when I set the child form to maximize its title-bar jumps over the Parent tool strip. Pushing it down a bit. I don’t what this. I would like the child to be completely contained within the Parent including the Parent forms tool strip.

I would also be fine if the child form had no Title Bar at all, I have no need for it.

childform.jpg



Thanks for any help on this, its driving me nuts!
Shane
 
Hi Shanew,

I went through the same situation once. Then i replaced the Toolstrip with with a panel and added whatever controls are required inside the panel so that it looks like a Toolstrip.
Then i set the FormWindowState property of the child form to Maximized on its load event.
In design mode, i set the ControlBox property of the child form to false and added one button to the panel created above to close the childform.

It worked fine. Just check if it is feasible for u......

Thanks
Panna
 
That's how MDI works. That's how MDI always works. If that's a big problem for you then I would suggest you consider whether and MDI application is really what you need. MDI stands for Multiple Document Interface. Do you really have multiple documents displayed in your interface? If you don't need to title bat on the child then do you even need a form at all? Could you not just add a user control or a Panel to your parent form?
 
Panel memory hogs?

Thanks for all the help here!

I’m leaning toward "Panels" but I’m concerned about memory overload.

So this app will have about 12 different "FORMS" or "Panels" available to be opened in the MDI depending upon what is selected from the MENU BAR...

If a USER opens the app and then only opens say 3 of the “Forms” it would use less memory, right?

If I use Panels and the use only uses 3 of them.. Is it not the same memory usage as if the user opened all 12 of the Panels?

Guess I’m thinning that all panels get loaded at start and then the visibility is turned on and off but with Forms they can be loaded as needed into memory. I’m completely open to being absolutely wrong about this.

On Sub note… Is there a way to Maximize a panel to fit with in the parent.

Thanks!
Shane
 
Use user controls rather than Panels. You can design each one individually, just as you can forms. You can then create an destroy them in code, as and when they are needed, just like forms.

As with any control, both Panels and user controls have a Dock property. If you want a control to fill the available space in its parent then set its Dock property to Fill.
 
No it is a bug

That's how MDI works. That's how MDI always works. If that's a big problem for you then I would suggest you consider whether and MDI application is really what you need. MDI stands for Multiple Document Interface. Do you really have multiple documents displayed in your interface? If you don't need to title bat on the child then do you even need a form at all? Could you not just add a user control or a Panel to your parent form?

That is NOT how MDI "always works". My MDI interface worked fine and maximized fine within the container form. Only after I add a ToolStrip did I start to have the problems described by the OP.

Anyone find a fix for this?

Thanx,
AG
 
No it is a bug
No, it's not.
That is NOT how MDI "always works".
Yes, it is.
Only after I add a ToolStrip did I start to have the problems described by the OP.
That doesn't change the fact about how MDI works and arrange title bars and menu bars.
Anyone find a fix for this?
Can you really fix something that is not broken? You may however customize the default behaviour, for example if the MDI parent has a main menustrip the maximized child forms icon and control box items will merge into that. If you also don't want to see that you can set Visible to False.
 
Back
Top