Re: VB6 Reload Application
Assuming your MDI Parent form is named MDIForm1 you could use something like this to close open forms while leaving the parent open.
Code:
Dim frm As Form
For Each frm In Forms
If frm.Name <> "MDIForm1" Then
Unload frm
End If
Next
Re: VB6 Reload Application
I'd use this, to finally close the master
Code:
Option Explicit
Dim AllowUnload As Boolean
Private Sub MDIForm_Load()
Form1.Show
Form2.Show
Form3.Show
End Sub
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
AllowUnload = True
End If
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
If AllowUnload Then
Exit Sub
End If
Cancel = True
AllowUnload = True
End Sub
Private Sub mnuClose_Click()
AllowUnload = False
Unload Me
End Sub
Private Sub mnuExit_Click()
AllowUnload = True
Unload Me
End Sub