VB.NET中,右上角的关闭按钮走的什么事件
3个回答
展开全部
Private Sub Form2_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
End '退出后关闭软件
End Sub
'点击关闭按钮时弹出对话框判断是否退出
Private Sub Form2_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
'经典判断关闭法
If MessageBox.Show("是否退出?", "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.Cancel Then
e.Cancel = True
Else
e.Cancel = False
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询