2.
Private Sub Confim(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If MessageBox.Show("真的要退出吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
If OleConn.State <> ConnectionState.Closed Then
OleConn.Close()
End If
End
Else
e.Cancel = True '不关闭
End If
End Sub