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.
Printable View
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.
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.
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.
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