普通学校 变式
Public Shared mdi_main As mdiMain
初中
进口系统:Windows.Forms
公共学校
Public forced_close As Boolean = False
Private Sub mdiMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
e.Cancel = True
If MsgBox("Are you sure you want to exit?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Close all child forms of the parent.
For Each ChildForm As Form In Me.MdiChildren
ChildForm.Close()
Next
e.Cancel = False
End If
End Sub
初中
Public Class frmMember
Private Sub frmMember_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
Select Case e.CloseReason
Case CloseReason.UserClosing
e.Cancel = True
If Not clsGlobalVariables.mdi_main.forced_close Then
If MsgBox("Are you sure you want to close?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
e.Cancel = False
End If
End If
Case Else
clsGlobalVariables.mdi_main.forced_close = True
e.Cancel = True
End Select
End Sub
初中