0

我创建了一个在 Windows 启动时启动的应用程序(在启动时),但我想安全地使用unload我的表单或close我的 vb 应用程序而不会丢失数据

4

1 回答 1

2

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.

于 2013-04-06T12:10:15.990 回答