OnBeforeViewChange Event

       

OnBeforeViewChange event as it applies to the PageWindowEx object.

Occurs before the view mode of the PageWindowEx object is changed.

Private Sub expression_OnBeforeViewChange(ByVal TargetView As FpPageViewMode, Cancel As Boolean)

expression   A variable name which references an object of type PageWindowEx declared with events in a class module.

TargetView  An FpPageViewMode enumerated constant that represents the new view type.

Cancel  A Boolean that determines if the operation will be cancelled. If True, the view will not be changed.

OnBeforeViewChange event as it applies to the WebWindowEx object.

Occurs before the view mode of the WebWindowEx object is changed.

Private Sub expression_OnBeforeViewChange(ByVal TargetView As FpWebViewMode, Cancel As Boolean)

expression   A variable name which references an object of type WebWindowEx declared with events in a class module.

TargetView  An FpWebViewMode enumerated constant that represents the new view type.

Cancel  A Boolean that determines if the operation will be cancelled. If True, the view will not be changed.

Example

The following example prompts the user before changing views. If the user clicks Yes, the view is changed.

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