Click to See Complete Forum and Search --> : Start position of child form


zoom14151
November 2nd, 1999, 07:30 PM
Can any one tell me why when I run a project with a MDIForm and child forms, the child forms doesn't start in the upper left corner of the MDIForm? I set all the child form to (top = 0). Is there another property that I'm missing.

Lothar Haensler
November 3rd, 1999, 01:49 AM
set the top property in the MDIChild form in the Form_Load event and it will work.
Windows assumes a default positioning sequence when creating MDI children.

November 30th, 1999, 11:33 AM
In VB6, at least. Even if you set the position of a child window in an
MDI to be anything other than 0 - Manual, you'll find that it reverts to
0 - Manual anyway each time you access it.

I found it far easier to just set the Top and Left properties of each child
form to 0 in their respective Form_Load events.

Ravi Kiran
December 1st, 1999, 12:23 AM
You can also set AutoSHowChildren Property of MDI to False. This will not show the child forms when you load.
So after loading, set its top & left properties, and then show. ie. all the code is in MDI itself
Ex: On some menu item seleciton:

dim tmpFrm as ChildFrm1
' set some properties, if you have

load tmpFrm
tmpFrm.Move 0,0 ' faster, only one resize event in child form
' set some more properties .. and then
tmpfrm.show
set tmpfrm = nothing




RK