GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / AnnotationClicked Event
Example





In This Topic
AnnotationClicked Event (GdViewer)
In This Topic
This event is raised when a GdPicture/XMP annotation has been clicked. This event occurs in the mouse down action.

Please check the corresponded GdViewer.AnnotationClickedEventHandler for given parameters.

Syntax
'Declaration
 
Public Event AnnotationClicked As GdViewer.AnnotationClickedEventHandler
public event GdViewer.AnnotationClickedEventHandler AnnotationClicked
public event AnnotationClicked: GdViewer.AnnotationClickedEventHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.AnnotationClickedEventHandler* AnnotationClicked
public:
event GdViewer.AnnotationClickedEventHandler^ AnnotationClicked
Remarks
Be aware, that this event only handles GdPicture/XMP annotations.
Example
How to add this event to your GdViewer control. This example shows you how to address the currently clicked annotation.
'We assume that the GdViewer1 control has been properly integrated.
Friend WithEvents GdViewer1 As GdPicture14.GdViewer
            
'Add the event.
AddHandler GdViewer1.AnnotationClicked, AddressOf GdViewer1_AnnotationClicked
            
'Define the event.
Sub GdViewer1_AnnotationClicked(ByVal AnnotationIdx As Integer) Handles GdViewer1.AnnotationClicked
    Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(AnnotationIdx)
    MessageBox.Show("The annotation with the index " + AnnotationIdx.ToString() + " has been clicked.", "GdViewer.AnnotationClicked")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
            
//Add the event.
GdViewer1.AnnotationClicked += GdViewer1_AnnotationClicked;
            
//Define the event.
void GdViewer1_AnnotationClicked(int AnnotationIdx)
{
    GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(AnnotationIdx);
    MessageBox.Show("The annotation with the index " + AnnotationIdx.ToString() + " has been selected.", "GdViewer.AnnotationClicked");
}
See Also