Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

place MDI child window in upper left?

Status
Not open for further replies.

capitano

Programmer
Jul 30, 2001
88
0
0
US
Does anyone know how to place successive child windows of an MDI application in the upper left? As they pile on top of each other, they are staggered by default--each child is slightly below and to the right of the previous child. I want to modify this default behavior and place them directly on top of each other.

I have been doing this:
Dim xyLoc As new System.drawing.point()
xyLoc.X = 0
xyLoc.Y = 0
childWindow.Show()
childWindow.Location = xyLoc

...

However, I don't like this very much because you can see the window actually moving as it comes onto the screen. It gives a less-than-professional appearance.

Thanks for any help,
Bryan
 
I did not have this problem, but try reversing the oreder to

childWindow.Show()
childWindow.Location = xyLoc

childWindow.Location = xyLoc
childWindow.Show()

and i think you are missing the line
childWindow.MDIParent = mainWindow

Hope I have been of help
ALMI
 
yup, I did those things and it still doesn't work. Actually, if I place the lines in this order:

childWindow.Location = xyLoc
childWindow.Show()

then, the child window does not move to the correct location at all. I think this is because you cannot specify a location for the child window before the window is shown. Anyway, that is my experience.

Thanks for the thoughts. Any other ideas?

Thank you,
Bryan Capitano
 
Have experimented with the StartPosition Property and ???

ALMI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top