Program won't exit when closed - TechRepublic
General discussion
January 1, 2003 at 08:53 AM
dartfrogs404

Program won’t exit when closed

by dartfrogs404 . Updated 23 years, 6 months ago

I created a program in Visual Basic using Visual Studio, with multiple forms. The first form calls the individual other forms by “formx.show”. When finished with the forms, I use “formx.hide”. This way the variables used in each form are available to each others.

The code to exit consists of:

Public Sub UnloadAllForms()
Dim Form As Form
For Each Form In Forms
Unload Form
Set Form = Nothing
Next Form
End Sub

then to call an exit is use:
Call UnloadAllForms
End

However, when I create an exe from this program, whenever I load and unload a form inside the program, exit only makes the program disappear. I must exit the program using the Task Manager.

How do I get it to exit by itself?

This discussion is locked

All Comments