AnnotationSelected Event (GdViewer)
In This Topic
This event is raised when a GdPicture/XMP annotation has been selected or deselected.
Please check the corresponded GdViewer.AnnotationSelectedEventHandler for given parameters.
Syntax
Example
How to add this event to your GdViewer control. This example shows you how to find out if the concerned annotation is selected or deselected.
'We assume that the GdViewer1 control has been properly integrated.
Friend WithEvents GdViewer1 As GdPicture14.GdViewer
'Add the event.
AddHandler GdViewer1.AnnotationSelected, AddressOf GdViewer1_AnnotationSelected
'Define the event.
Sub GdViewer1_AnnotationSelected(ByVal AnnotationIdx As Integer) Handles GdViewer1.AnnotationSelected
Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(AnnotationIdx)
If annot.Selected Then
MessageBox.Show("The annotation with the index " + AnnotationIdx.ToString() + " has been selected.", "GdViewer.AnnotationSelected")
Else
MessageBox.Show("The annotation with the index " + AnnotationIdx.ToString() + " has been deselected.", "GdViewer.AnnotationSelected")
End If
End Sub
//We assume that the GdViewer1 control has been properly integrated.
//Add the event.
GdViewer1.AnnotationSelected += GdViewer1_AnnotationSelected;
//Define the event.
void GdViewer1_AnnotationSelected(int AnnotationIdx)
{
GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(AnnotationIdx);
if (annot.Selected)
MessageBox.Show("The annotation with the index " + AnnotationIdx.ToString() + " has been selected.", "GdViewer.AnnotationSelected");
else
MessageBox.Show("The annotation with the index " + AnnotationIdx.ToString() + " has been deselected.", "GdViewer.AnnotationSelected");
}
Example
How to add this event to your GdViewer control. This example shows you how to find out if the concerned annotation is selected or deselected.
'We assume that the GdViewer1 control has been properly integrated.
Friend WithEvents GdViewer1 As GdPicture14.GdViewer
'Add the event.
AddHandler GdViewer1.AnnotationSelected, AddressOf GdViewer1_AnnotationSelected
'Define the event.
Sub GdViewer1_AnnotationSelected(ByVal AnnotationIdx As Integer) Handles GdViewer1.AnnotationSelected
Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(AnnotationIdx)
If annot.Selected Then
MessageBox.Show("The annotation with the index " + AnnotationIdx.ToString() + " has been selected.", "GdViewer.AnnotationSelected")
Else
MessageBox.Show("The annotation with the index " + AnnotationIdx.ToString() + " has been deselected.", "GdViewer.AnnotationSelected")
End If
End Sub
//We assume that the GdViewer1 control has been properly integrated.
//Add the event.
GdViewer1.AnnotationSelected += GdViewer1_AnnotationSelected;
//Define the event.
void GdViewer1_AnnotationSelected(int AnnotationIdx)
{
GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(AnnotationIdx);
if (annot.Selected)
MessageBox.Show("The annotation with the index " + AnnotationIdx.ToString() + " has been selected.", "GdViewer.AnnotationSelected");
else
MessageBox.Show("The annotation with the index " + AnnotationIdx.ToString() + " has been deselected.", "GdViewer.AnnotationSelected");
}
See Also