Close Mdi Child

Any Ideas why this wont close the Mdi Child Form
Code Below
Thanks Joe

******************
Public
Function CheckActiveMidChild(ByVal myForm As Form) As Boolean

Dim objMdiChild As Form = PMC_form.ActiveMdiChild
Dim Bit As Boolean = False

For Each objMdiChild In PMC_form.MdiChildren

If objMdiChild.Name.ToString.Equals(frmFormName.Name) Then

Bit = True

Exit For

End If

Next

myForm.Close()

Return Bit

End Function



Answer this question

Close Mdi Child

  • www.GaaLive.com

    I'm not quite sure what this function is supposed to do, because your code references some variables that aren't described.  It looks like it checks to see if a specified form is among the MDIParen'ts children, and it closes the form passed in regardless.  Perhaps you could explain what you want to accomplish

    In any case, a form will not close if any of its controls do not validate.  Perhaps this is the problem

  • Close Mdi Child