由于以前用VB6.0做过系统,编辑的时候第一个想的是unload方法,但是实际不是这样的,VB.net 中根本就没有unload方法,但是看到了frmclosing方法,接着我就写了程序:
Private Sub Frmmain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If MsgBox("你真的要退出吗?", vbOKCancel, "提示") = vbCancel Then
e.Cancel = True
Else
Dim BOffwork As New BllOffwork
Dim EOnwork As New Onwork
Dim EWorkRecord As New WorkRecord
Dim strUserName As String = FrmLogin.strUserName
Try