OnBeforeWebWindowSubViewChange Event

       

Occurs before the sub window of the current web window is changed by the user.

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

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

pWebWindow   The WebWindowEx object that contains the sub window.

TargetSubView   The sub 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 sub window view is changed. The Cancel argument is modified based on the users' response.

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