Reference Guide
GdPicture14.WPF Namespace / GdViewer Class / CurrentPage Property
Example





In This Topic
    CurrentPage Property (GdViewer)
    In This Topic
    Gets the page number of the currently selected and displayed page of the document loaded in the GdViewer control. The pages are numbered starting from 1.
    Syntax
    'Declaration
     
    
    Public ReadOnly Property CurrentPage As Integer
    public int CurrentPage {get;}
    public read-only property CurrentPage: Integer; 
    public function get CurrentPage : int
    public: __property int get_CurrentPage();
    public:
    property int CurrentPage {
       int get();
    }

    Property Value

    The pages are numbered starting from 1 to PageCount.
    Remarks
    Please note that the pages are numbered starting from 1.
    Example
    How to determine the currently displayed page of the loaded document.
    'We assume that the GdViewer1 control has been properly integrated.
    If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
        MessageBox.Show("PageCount = " + GdViewer1.PageCount.ToString() + vbCrLf +
                        "CurrentPage = " + GdViewer1.CurrentPage.ToString(), "GdViewer.CurrentPage")
    Else
        MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.CurrentPage")
    End If
    //We assume that the GdViewer1 control has been properly integrated.
    if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
    {
        MessageBox.Show("PageCount = " + GdViewer1.PageCount.ToString() +
                        "\nCurrentPage = " + GdViewer1.CurrentPage.ToString(), "GdViewer.CurrentPage");
    }
    else
        MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.CurrentPage");
    See Also