Private Sub UserForm_QueryClose(cancel As Integer, closemode As Integer)if closemode =0 then '判断是否用点击叉叉来关闭窗口 Cancel = 0 '关闭窗体end if
Private Sub UserForm_Terminate() MsgBox "Window close"End Sub