Vighanesh Gursale
Vighanesh Gursale

Reputation: 921

how to close vb application when shutdown event occurs

I have created an application that starts when windows starts (on startup) but i want to unload my form or close my vb application securely without losing data

Upvotes: 0

Views: 1192

Answers (1)

Steve
Steve

Reputation: 216363

The FormClosing event should be the place where you handle expected or unexpected closing of your forms.

This event receives a FormClosingEventArgs that contains the reason for the shutdown of your form.

There is also a more generic Application.ApplicationExit but it lacks the details given by the FormClosingEventArg parameter passed to the FormClosing event.

How you handle the data that need to be saved could be the discriminant factor in choosing between the two methods.

Upvotes: 2

Related Questions