在站点窗口子视图更改之前发生。
Private Sub expression_OnBeforeSubViewChange(ByVal TargetSubView As FpWebSubView, Cancel As Boolean)
expression 引用 WebWindowEx 类型对象的变量名称,该对象是在类模块中以事件方式声明的。
TargetSubView FpWebSubView 枚举常数,表示新子视图类型。
Cancel Boolean 类型,确定操作是否会被取消。如果为 False,则子视图将更改视图类型。
下列示例在更改站点窗口的子视图之前提示用户。如果用户单击“否”,则子视图不会更改。如果用户单击“是”,则子视图将更改为新的视图类型。
Private Sub objwebWindow_OnBeforeSubViewChange
(ByVal TargetSubView As FpWebSubView, Cancel As Boolean)
'Occurs when the subview of the active web window is changed
Dim strAns As String
'Prompt user
strAns = MsgBox("Are you sure you want to change the subview?", vbYesNo)
If strAns = vbYes Then
Cancel = False
Else
Cancel = True
End If
End Sub