全部显示

OnClose 事件

       

应用于 PageWindowEx 对象的 OnClose 事件。

应用于 WebEx 对象的 OnClose 事件

示例

下列示例在关闭活动网页窗口之前提示用户。如果用户单击“否”,则窗口不会关闭。

Private Sub PgeWindowEx_OnClose(Cancel As Boolean)
'Displays a message

    Dim strAns As String
    'Prompt user
    strAns = MsgBox("Are you sure you want to close the active page window?", _
                    vbYesNo)
    If strAns = vbYes Then
        Cancel = False
    Else
        Cancel = True
    End If

End Sub