我想在用户单击 x 按钮之后但程序退出之前执行一些操作。
这可能吗?如果是的话我该怎么做?
最佳答案
查看表单关闭事件
VB.Net 代码示例:
Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
End Sub
和 C#
private void Form1_FormClosing(System.Object sender, System.Windows.Forms.FormClosingEventArgs e)
{
}
关于c# - 在c#中关闭winform应用程序之前执行一些操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13510884/