似是而非

导航

Form窗体事件

1)Form的Load事件:

打开窗体即可显示

2)Form的Closing事件:

关闭时显示。

Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing

   If MsgBox("您确定要关闭本系统吗?", MsgBoxStyle.OKCancel, Me.Text) = MsgBoxResult.OK Then

      Me.DialogResult = DialogResult.Cancel

            e.Cancel = False

      Else

            e.Cancel = True

      End If

 End Sub

posted on 2009-11-25 13:57  似是而非  阅读(237)  评论(0编辑  收藏  举报