OnBeforeWebWindowViewChange Event

       

Occurs before the web window view changes.

Private Sub application__OnBeforeWebWindowViewChange(ByVal pWebWindow As WebWindow, ByVal TargetView As FpWebViewModeEx, Cancel As Boolean)

application   An object of type Application declared with events in a class module.

pWebWindow   The WebWindowEx object that contains the view.

TargetView   The FPWebViewModeEx window view type.

Cancel   A Boolean that determines if the event will be cancelled. If False, the event will not be cancelled. If True, the event will be cancelled.

Example

The following example prompts the user before the current view is changed. The Cancel argument is modified based on the users' response.

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