OnBeforeWebWindowSubViewChange 事件

       

在用户更改当前站点窗口的子窗口之前发生。

Private Sub application__OnBeforeWebWindowSubViewChange(ByVal pwebwindow As WebWindow, ByVal TargetSubView As FpWebSubView, Cancel As Boolean)

application  在类模块中以事件方式声明的 Application 类型的对象。

pWebWindow  包含子窗口的 WebWindowEx 对象。

TargetSubView  子窗口视图类型。

Cancel  Boolean 类型,确定事件是否会被取消。如果为 False,则事件不被取消。如果为 True,则事件被取消。

示例

下列示例在当前子窗口视图更改之前提示用户。Cancel 参数将根据用户的响应被修改。

Private Sub objApp_OnBeforeWebWindowSubViewChange(ByVal pwebwindow As WebWindow, _
                                                  ByVal TargetSubView As FpWebSubView, _
                                                  Cancel As Boolean)
'Occurs before the web window sub view is changed. Prompts the user to verify the change

    Dim strAns As String
    'Prompt the user before changing views
    strAns = MsgBox("Are you sure you want to change the sub window view?", _
                     vbYesNo)
    If strAns = vbYes Then
        'Yes, don't cancel the event
        Cancel = False
    Else
        'No, cancel the event
        Cancel = True
    End If

End Sub