Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21189

Finding Child Forms Closing Point

$
0
0
hi everyone,
I am using a MDI form which contains many childs. I want to execute a certain code "only if the child is individually close". And I dont want that executed if the main MDI form is closed. I tried putting a boolean global variable in the MDI_Unload and MDI_Terminate events. And checking the boolean at the form_unload event of child, still the code executes.
Example:

Private Sub MDIForm_Terminate() 'In Main Form
CloseAllTabs = True
End Sub

Private Sub Form_Unload(Cancel As Integer)
If Not CloseAllTabs Then MsgBox Me.Caption
End Sub

the message box pops up everytime. Even if MDIForm is closed. Help me.
thanks in advance.

Viewing all articles
Browse latest Browse all 21189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>