Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If MsgBox("确认关闭?", vbYesNo, "提示") = vbNo Then e.Cancel = True Else Me.Dispose() End If End Sub