I have a form that i close using End several times in my code. I want to do a command to save settings when I do this called VarsToIni() which takes some public variables and saves them in an INI file. I have tried putting it in the main window’s FormClosing (which stays open throughout) and this only works when you close from pressing the X button not from my End statement.
I have a form that i close using End several times in my code.
Share
Add a new Sub and replace calls to
Endwith calls to your new Sub:Edit:
As Dan points out,
End()is a bad way to close the application,Application.Exit()is preferred.