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
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.
You can use -2 to select all annotation objects at once when AnnotationEnableMultiSelect is set to true.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
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");
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