且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用户窗体关闭事件

更新时间:2023-12-06 11:28:28

例如,您可以将下面的宏添加到 UserForms 代码模块中:

For example, you can add the macro below to the UserForms code module:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    If CloseMode = vbFormControlMenu Then
        Cancel = True
        MsgBox "You can't close the dialog like this!"
    End If
End Sub