I have two Issue using a MDI app.
1-at this moment I'm able to open MDI child forms using the MDIparent
except when the I opens form1 I'm also able to open forms 2
and 3 .
but I only want one form to be open at a time.
2- The next issue is I have form 2 to be opened from form1 and I would like to close form2 and form1 when click close on form2. At this moment I have to close form2 then click close on form1.
Thank you
code for Q1 This is the code on the MDIparent to open the forms.
Public Sub tbbCustomer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbbCustomer.Click
Dim CustomerMDIChild As New CustumerRprt()
CustomerMDIChild.MdiParent = Me
CustomerMDIChild.Show()
CustomerMDIChild.Location = New Point(Me.Width / 2 - CustomerMDIChild.Width / 2, Me.Height / 2 - CustomerMDIChild.Height / 2)
End Sub
Q2 here is he code I tried to close form2 and form1.
Public Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
If m_ID = 0 Then
Me.Close()
Else
CustumerRprt.Close()
Me.Close()
End If
End Sub