在站点窗口视图更改之前发生。
Private Sub application__OnBeforeWebWindowViewChange(ByVal pWebWindow As WebWindow, ByVal TargetView As FpWebViewModeEx, Cancel As Boolean)
application 在类模块中以事件方式声明的 Application 类型的对象。
pWebWindow 包含视图的 WebWindowEx 对象。
TargetView FPWebViewModeEx 窗口视图类型。
Cancel Boolean 类型,确定事件是否会被取消。如果为 False,则事件不被取消。如果为 True,则事件被取消。
下列示例在当前视图更改之前提示用户。Cancel 参数将根据用户的响应被修改。
Private Sub objApp_OnBeforeWebWindowViewChange(ByVal pWebWindow As WebWindow, _
ByVal TargetView As FpWebViewModeEx, _
Cancel As Boolean)
'Occurs before the view is changed in the web window. 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 view mode?", _
vbYesNo)
If strAns = vbYes Then
'Yes, don't cancel the event
Cancel = False
Else
'No, cancel the event
Cancel = True
End If
End Sub