OnBeforeWebWindowSubViewChange Event

Microsoft FrontPage Visual Basic

OnBeforeWebWindowSubViewChange Event

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

Private Sub expression_OnBeforeWebWindowSubViewChange(ByVal pwebwindow As WebWindowEx, ByVal TargetSubView As FpWebSubView, Cancel As Boolean)

expression     An object of type Application declared using the WithEvents keyword 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 changing the current sub window view. The Cancel argument is modified based on the users' response.

Private Sub objApp_OnBeforeWebWindowSubViewChange(ByVal pwebwindow As WebWindowEx, _
        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