Reference Guide
GdPicture14.WPF Namespace / GdViewer Class / DisplayPreviousPage() Method
Example





In This Topic
    DisplayPreviousPage() Method
    In This Topic
    Displays the previous page, if any is available, of the document currently loaded in the GdViewer control. You can use the CurrentPage property to determine the currently displayed page.

    The PageDisplayed and the PageChanged events, respectively the PreviewPageDisplayed and the PreviewPageChanged events, are raised after the page has been successfully displayed and changed.

    Be aware that the SaveAnnotationsToPage method is called internally before each page change.

    Syntax
    'Declaration
     
    
    Public Function DisplayPreviousPage() As GdPictureStatus
    public GdPictureStatus DisplayPreviousPage()
    public function DisplayPreviousPage(): GdPictureStatus; 
    public function DisplayPreviousPage() : GdPictureStatus;
    public: GdPictureStatus DisplayPreviousPage(); 
    public:
    GdPictureStatus DisplayPreviousPage(); 

    Return Value

    A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
    Remarks
    Please note that if no previous page is available, this method does nothing.

    Just to remind you that both the PageDisplayed and the PageChanged events, respectively the PreviewPageDisplayed and the PreviewPageChanged events, are raised using this method.

    Example
    How to introduce the page browsing feature in your viewer.
    'We assume that the GdViewer1 control has been properly integrated
    'and your document has been properly displayed as well.
    Enum Direction
        FirstP
        LastP
        NextP
        PreviousP
    End Enum
    Sub DoMove(ByVal MoveTo As Direction)
        Dim status As GdPictureStatus = GdPictureStatus.OK
        Select Case MoveTo
            Case Direction.FirstP
                status = GdViewer1.DisplayFirstPage()
            Case Direction.LastP
                status = GdViewer1.DisplayLastPage()
            Case Direction.NextP
                status = GdViewer1.DisplayNextPage()
            Case Direction.PreviousP
                status = GdViewer1.DisplayPreviousPage()
            Case Else
        End Select
        If status <> GdPictureStatus.OK Then MessageBox.Show("Failure: " + status.ToString(), "GdViewer.DisplayPreviousPage")
    End Sub
    //We assume that the GdViewer1 control has been properly integrated
    //and your document has been properly displayed as well.
    enum Direction { FirstP, LastP, NextP, PreviousP };
    void DoMove(Direction MoveTo)
    {
        GdPictureStatus status = GdPictureStatus.OK;
        switch (MoveTo)
        {
            case Direction.FirstP: status = GdViewer1.DisplayFirstPage(); break;
            case Direction.LastP: status = GdViewer1.DisplayLastPage(); break;
            case Direction.NextP: status = GdViewer1.DisplayNextPage(); break;
            case Direction.PreviousP: status = GdViewer1.DisplayPreviousPage(); break;
            default: break;
        }
        if (status != GdPictureStatus.OK) MessageBox.Show("Failure: " + status.ToString(), "GdViewer.DisplayPreviousPage");
    }
    See Also