Reference Guide
GdPicture14.WPF Namespace / GdViewer Class / SelectAnnotation Method
The 0-based index of the required annotation within the current page of the displayed document. It must be a value from 0 to GetAnnotationCount-1.

You can use -1 to deselect all annotation objects at once.

Example





In This Topic
    SelectAnnotation Method (GdViewer)
    In This Topic
    Selects a required GdPicture/XMP annotation object specified by its index related to the current page of the document displayed in the GdViewer control.

    Be aware that this method only handles GdPicture/XMP annotations.

    Syntax
    'Declaration
     
    
    Public Function SelectAnnotation( _
       ByVal AnnotationIdx As Integer _
    ) As GdPictureStatus
    public GdPictureStatus SelectAnnotation( 
       int AnnotationIdx
    )
    public function SelectAnnotation( 
        AnnotationIdx: Integer
    ): GdPictureStatus; 
    public function SelectAnnotation( 
       AnnotationIdx : int
    ) : GdPictureStatus;
    public: GdPictureStatus SelectAnnotation( 
       int AnnotationIdx
    ) 
    public:
    GdPictureStatus SelectAnnotation( 
       int AnnotationIdx
    ) 

    Parameters

    AnnotationIdx
    The 0-based index of the required annotation within the current page of the displayed document. It must be a value from 0 to GetAnnotationCount-1.

    You can use -1 to deselect all annotation objects at once.

    Return Value

    A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
    Remarks
    Be aware that annotations are always treated relative to the currently displayed page.

    You can regularly apply the GetStat method to determine if this method has been successful.

    Example
    How to select the first available annotation on the currently displayed page.
    'We assume that the GdViewer1 control has been properly integrated
    'and your document has been properly displayed as well.
    Dim annotCount As Integer = GdViewer1.GetAnnotationCount()
    If annotCount > 0 Then
        GdViewer1.SelectAnnotation(0)
        MessageBox.Show("Done!", "GdViewer.SelectAnnotation")
    Else
        MessageBox.Show("This page does not contain any GdPicture/XMP annotations.", "GdViewer.SelectAnnotation")
    End If
    //We assume that the GdViewer1 control has been properly integrated
    //and your document has been properly displayed as well.
    int annotCount = GdViewer1.GetAnnotationCount();
    if (annotCount > 0)
    {
        GdViewer1.SelectAnnotation(0);
        MessageBox.Show("Done!", "GdViewer.SelectAnnotation");
    }
    else
        MessageBox.Show("This page does not contain any GdPicture/XMP annotations.", "GdViewer.SelectAnnotation");
    See Also