Another MDI?

  • Thread starter Thread starter nolc
  • Start date Start date
N

nolc

Guest
Ok...I have an MdiParent form named MAIN & 3 other forms as MdiChildren. When I call a frmEditOrder.Show from the Tracking form it loads a brand new form and doesn't include it within the Parent Form, MAIN. Any ideas? Below is my code thus far.....


Code:
[B]' MAIN CODE [/B]
Private Sub MAIN_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        OrderEntry.MdiParent = Me
        Tracking.MdiParent = Me
        frmEditOrder.MdiParent = Me
    End Sub

    Private Sub mnuTracking_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuTracking.Click
        Tracking.Show()
        Tracking.WindowState = FormWindowState.Normal
        Tracking.StartPosition = FormStartPosition.CenterScreen
    End Sub

[B]' Tracking CODE [/B]
Dim frmEditOrder As EditOrder = New EditOrder()

With frmEditOrder
    .StartPosition = FormStartPosition.CenterParent
    .Show()
End With
 
Just calling a frmEditOrder.Show from the MDI Parent form is not enough to tell the new form to be a child form. You have to do it like this:

Visual Basic:
Dim f As New frmEditOrder()
f.MDIParent = Me
f.Show()
 
Back
Top