arranging mdi child forms

i have an mdi application that displays several forms of fixed size. i need:

1. the child forms to be arranged tiled horizontally.
2. forms once arranged should not be moveable.
3. vertical scroll bar to appear as no of forms grow.
4. no horizontal scroll bar should appear.
5. all forms must be fully displayed i.e no overlaping.

plz help me. i m doing this in visual studio 2005. any solutions would be highly appreciated.


  • I am not fully familiar with the MDI application wizard, but all these different project types do is just pre-generate code for you. This means in order to alter the default functionality you are going to have to alter the pregenerated code.

    Taking a quick look at the MDI form, you're in for a headache for what you are asking.

    First you will have to find every place the pregenerated code is creating the children forms because it doesn't appear to be using a single function for this. You will have to either alter the properties on the children form to fit your needs, or inherit the form class onto your own class so you can set the defaults and overrides for example: the title bar drag functionality.

    Then you will have to instead of adding children to the MDI parent, add a FlowLayoutPanel to get the proper tiling functionality you want, set the auto scroll property to true, and the flow direction to TopDown. OR you can recreate this functionality yourself in your MDI form, but either way it's going to be a pain because...

    if you are using another container to hold your child forms, then any code that might be looking for those forms later like a print or save function or something (I don't really know all the interworkings) and then alter the code to look in the new container instead - and for your inherited class rather than whatever it was using before.

    I'm not trying to discourage you from making your application the way you want it.

    What I am trying to illustrate is that it might be better for you to analyze the functionality you want from the MDI application and just build your own from scratch so you can make it function properly.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion