Setting MDI Parent / Child
Hi All,
I have an MDI Parent form (frmMDI) that calls a child form (frmChild1). frmChild1 calls another child form (frmChild2). in the form load event for frmChild2, i close frmChild1. The problem is, that when frmChild2 opens, it is not a child form of frmMDI and i am having problems trying set frmChild2 to be a child a frmMDI...here is some code...
'CONSTRUCTOR FOR frmChild2
'DOESN'T PRODUCE AN EXCEPTION, BUT WON'T WORK EITHER
Public Sub New(parentForm As Form)
MyClass.New()
Me.MdiParent = parentForm
End Sub
'THIS CODE CLOSES frmChild1
Private Sub frmChild2_Form_Load()
Try
frmChild1.ActiveForm.ActiveMdiChild.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
end sub
|