danorme
asked on
Trying to Get MDIParent to run a sub after it see's NO MDIChild forms present(open)
I have a MDIParent which needs to be able to see when all the MDIChild Forms have been Closed so that I may run a sub process. Any ideas.
Oh, I am pretty new at VB, so some code example may help.
Thanks.
Oh, I am pretty new at VB, so some code example may help.
Thanks.
What version VB?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if vb6
add this routine to module
Public Sub showlastformMsg()
If Forms.Count = 2 Then
MsgBox "last mdi child closed"
End If
End Sub
add this on each mdi child
Private Sub Form_Unload(Cancel As Integer)
showlastformMsg
End Sub
add this routine to module
Public Sub showlastformMsg()
If Forms.Count = 2 Then
MsgBox "last mdi child closed"
End If
End Sub
add this on each mdi child
Private Sub Form_Unload(Cancel As Integer)
showlastformMsg
End Sub
may be you want to hide the form before
Private Sub Form_Unload(Cancel As Integer)
Me.Hide
showlastform
End Sub
Private Sub Form_Unload(Cancel As Integer)
Me.Hide
showlastform
End Sub