469,593 Members | 1,741 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,593 developers. It's quick & easy.

True tiling of MDI forms?

By true tiling I don't mean the vertical or horizontal tiling that is
normally though of like...

123

or

1
2
3

rather, I would like to know how to tile like

1 2
3 4

.......any ideas?
Nov 20 '05 #1
1 847
Well if you haven't already had a look at the MdiLayout enumeration, i'd
suggest you start there.
The basic idea behind what your looking to do is not availbale via this
enumeration, but would be dead simple to custom code. It would go something
like:
Private Sub OnCustomLayout(children as form(), heightStack as integer,
widthStack as integer)

if children is nothing orelse children.length then throw
ArgumentNullException("children", "I know children should be seen and not
heard but this just plain rediculous.")

if heightStack<=0 orelse widthStack <=0 then throw
ArgumentOutOfRange("Message here")

dim recs(children.length-1) as new Rectangle
dim i, childHeight, childWidth as integer
1. Divide MDIParent height by heightStack = childHeight
2. Divide MDIParent widht by width stack. = childWidth

I'd round up for 1/2 so you are assured of fitting all windows in MDIParent
(you can adjust final window to fill all remaining space if any)

3 . Create a rectangle which basically just a size and location (which you
offset per rectangle) starting at (0,0)
and add to recs.

4. Then just assign the size and location to each child window by looping
through Mdi children / recs array.

' You wouldn;t even necessarily need the recs array but it keeps things tidy
and you can resort your windows or whatever using it... so long as the
number of child window doesn;t change.

End Sub

hth
Richard
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jim Hubbard | last post: by
16 posts views Thread by WindAndWaves | last post: by
3 posts views Thread by Piotrek Stachowicz | last post: by
3 posts views Thread by Viken Karaguesian | last post: by
1 post views Thread by BerkshireGuy | last post: by
reply views Thread by kirby.urner | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.