LeighWardle
asked on
VB6 - why is Sub MDIForm_Load() being called when I terminate my program?
Hi,
I am using some code (snippet below) from this webpage (see below "Avoid the End Statement"):
http://www.pgacon.com/visualbasic.htm
But I have been debugging this code, and I have just noticed that the Sub MDIForm_Load() is being called.
That doesn't seem right to me.
Regards,
Leigh
I am using some code (snippet below) from this webpage (see below "Avoid the End Statement"):
http://www.pgacon.com/visualbasic.htm
But I have been debugging this code, and I have just noticed that the Sub MDIForm_Load() is being called.
That doesn't seem right to me.
Regards,
Leigh
Public Sub TerminateProgram()
Static Unloading As Boolean
Dim idx As Integer
If Unloading Then Exit Sub
Unloading = True
For idx = Forms.Count - 1 to 0 Step -1
Unload Forms(idx)
Next idx
Unloading = False
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER