全部显示

OnBeforeViewChange 事件

       

应用于 PageWindowEx 对象的 OnBeforeViewChange 事件。

应用于 WebWindowEx 对象的 OnBeforeViewChange 事件。

示例

下列示例在更改视图之前提示用户。如果用户单击“是”,则视图将会更改。

Private Sub PgeWindowEx_OnBeforeViewChange(ByVal TargetView As FpPageViewMode, _
                                                    Cancel As Boolean)
'Prompts user before changing views

    Dim blnAns As Boolean
    strAns = MsgBox("Are you sure you want to change the current view?", _
                    vbYesNo)
    If strAns = vbYes Then
        Cancel = False
    Else
        Cancel = True
    End If

End Sub