0
votes

I have a Mdi parent container and i am using menu item to open child forms in MDI Parent Form.

Here is the code for opening the child form

Dim childform1 as new Form3
childform1.MDIParent = me
childform1.show()

The above code is working fine. The problem is with the startup position of the child form. i.e. child form doesn't open at required position(just right below the menubar) instead it opens at position randomly. like sometimes near the required position and other times where it wishes.. lol is there any standard way to position it. I tried MDI Child Form Start Position Problem answer by calculating and its positioned near by where i want. But I want to look for a standard way for doing this.

1
Can't you just set the Top and Left properties of the child form before you call .Show?Matt Wilko
Sir, Yes i can. I just want to know the correct way like a simple winform has 'start position' property.Sahil
This is the normal way MDI works, child windows open at staggered positions so they don't overlap each other. You override this by setting the StartPosition to Manual and picking the Location property value wisely. Being wise is not exactly very simple.Hans Passant

1 Answers

0
votes

This should do it: childform1.location = new point(x, y)

Inside the childform, you can add this: Me.StartPosition = FormStartPosition.Manual Then you can set location before saying childform1.show()