How to stop MDIchild forms opening in different locations

48 Views Asked by At

I am upgrading a VB 2008 application that uses MDIparent and child(s). Migrating it to VB2017. I am experiencing the following symptom. When I open the first child form (call it form1) it opens where I want it to. But if I open that same form (Form1) when a different MDIchild (Form2) is open the control on the form1 move upwards (not in same location but also not cascade) When I call a form1 from MDIparent here is the code

    EraseErrorBox()
    Me.Cursor = Cursors.WaitCursor
    Dim frm As New FrmMonthlyInv()
    frm.MdiParent = Me
    frm.Show()
    frm.BringToFront()
    frm.StartPosition = FormStartPosition.Manual
    frm.Location = New Point(0, 0)
    Me.Cursor = Cursors.Default

Here is a pick of top of screen when it is first form called

enter image description here

here is when it is not first form open

enter image description here

properties of form that i changed.

minimizeBox = false
maximizeBox = false
startPosition =CenterParent
WindowsState = Maximized
FormBorderstyle =None

Appreciate anyone with a way to keep form in same location no matter is first, second or whatever form. Need to have more than one form open with current one covering the others.

0

There are 0 best solutions below