MDI Forms and child form height and width properties

O

OpticTygre

Hi folks.

I've created an MDI form. In this form there are several panels, and
several splitters. There is a vertical panel docked on the left, and 2
horizontal panels docked on the top and bottom. This leaves an area (right
side, middle area) of the form available to load/unload other forms. I
don't want these other forms to have Max/Min/Close buttons, so I set the
"FormBorderStyle" Property equal to "None" on those forms that will be
loaded.

My question is, how can I either get the size of the working area left on
the MDI Parent form dynamically, or how can I automatically size whatever
child forms are loaded in that area not to be smaller or larger than the MDI
working area? (See Below)

============================
= = Panel
= P ======================
= A = =
= N = =
= E = Place where =
= L = child forms =
= = loaded =
= = =
= ======================
= = Panel
============================

Thanks,

-Tygre
 
J

Jeff Johnson [MVP: VB]

I've created an MDI form.

Given what you're trying to do, I would say this was your first mistake. MDI
was not designed to behave the way you're trying to make it behave. You'll
bang your head against a wall trying to fight MDI. I would recommend that
you create UserControls to use as your "child forms."
 
O

OpticTygre

Good suggestion, but I think that would also be more of a pain than it's
worth. The idea is having a treeview control on the left side, and
depending on what node is clicked, having options appear on the right side
(where the child forms would be loaded). I figured having separate forms
for each set of options would be easier than having a normal form with
panels and options that I'd have to set to visible and invisible each time a
node is clicked. Something like that is a pain to design, as you have to
drop controls on top of eachother, set tags, etc... It makes the design of
the form quite a mess. Any other suggestions of doing something like this?
 
J

Jeff Johnson [MVP: VB]

Good suggestion, but I think that would also be more of a pain than it's
worth. The idea is having a treeview control on the left side, and
depending on what node is clicked, having options appear on the right side
(where the child forms would be loaded). I figured having separate forms
for each set of options would be easier than having a normal form with
panels and options that I'd have to set to visible and invisible each time a
node is clicked. Something like that is a pain to design, as you have to
drop controls on top of eachother, set tags, etc... It makes the design of
the form quite a mess. Any other suggestions of doing something like
this?

Nope. Any time people describe this sort of app and ask to do it with MDI
the general response is "don't use MDI." This is basically an Outlook-style
application.

You know, you can load UserControls dynamically with Reflection. If you
implement a common interface then you can talk to them from your main form
as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top