OnBeforeWebWindowViewChange Event

Microsoft FrontPage Visual Basic

OnBeforeWebWindowViewChange Event

Occurs before the Web site window view changes.

Private Sub expression__OnBeforeWebWindowViewChange(ByVal pWebWindow As WebWindowEx, ByVal TargetView As FpWebViewModeEx, 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 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 changing the current view. The Cancel argument is modified based on the users' response.

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