0

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.

Tom
  • 151
  • 1
  • 12
  • Almost worth to close - quite hard to understand. Well, if you do not remove second form title buttons and border, does it behave any better? Form itself is probably at same location, just its client area shifts. – Arvo Apr 29 '20 at 17:55
  • there isn't a title bar for any of the forms. if you look the groupbox that the PO# is in is closer to the tan bar that is on MDI parent form – Tom Apr 29 '20 at 18:05
  • Now I am at complete loss :) You mean those gray areas on your images are MDI child forms and groupboxes shift when displayed? In debugger, what are child form coordinates after activation? I would think that form itself is moved, not controls. Maybe that CenterParent works differently from old VB? – Arvo Apr 29 '20 at 18:13
  • if first form opened top comes back as 0 in debug mode. If not first form comes back -8 – Tom Apr 29 '20 at 18:43
  • Set its location manually then? If you set it, but it moves afterwards, try to find, when and why it moves - I can't see other ways to solve such poblem. Why your top bars heights differ, btw? – Arvo Apr 30 '20 at 07:20

0 Answers0