Public Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
'退出系统
Dim tw As Integer
On Error Resume Next
tw = MsgBox("是否退出系统?", vbQuestion + vbYesNo)
If tw = vbNo Then
e.Cancel = True
Exit Sub
End If
End
End Sub