Is there a way to call a function in a C# Windows forms application before the application exits, independent of the event that closed the application (i.e. closing by pressing 'X', terminating through taskmanager, etc.)
Sorry I didn't see that the question was already answered but the formulation of the question didn't let me find what I was looking for!