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





In This Topic
AnnotationAddedByUser Event (GdViewer)
In This Topic
This event is raised right after a new GdPicture/XMP annotation has been added by a user. This event occurs in the mouse up action.

Please check the corresponded GdViewer.AnnotationAddedByUserEventHandler for given parameters.

Syntax
'Declaration
 
Public Event AnnotationAddedByUser As GdViewer.AnnotationAddedByUserEventHandler
public event GdViewer.AnnotationAddedByUserEventHandler AnnotationAddedByUser
public event AnnotationAddedByUser: GdViewer.AnnotationAddedByUserEventHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.AnnotationAddedByUserEventHandler* AnnotationAddedByUser
public:
event GdViewer.AnnotationAddedByUserEventHandler^ AnnotationAddedByUser
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 added annotation for changing its properties.
'We assume that the GdViewer1 control has been properly integrated.
Friend WithEvents GdViewer1 As GdPicture14.GdViewer
            
'Add the event.
AddHandler GdViewer1.AnnotationAddedByUser, AddressOf GdViewer1_AnnotationAddedByUser
            
'Define the event.
Sub GdViewer1_AnnotationAddedByUser(ByVal AnnotationIdx As Integer) Handles GdViewer1.AnnotationAddedByUser
    Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(AnnotationIdx)
    annot.Author = "GdPicture"
    If TypeOf annot Is GdPicture14.Annotations.AnnotationStickyNote OrElse
       TypeOf annot Is GdPicture14.Annotations.AnnotationText Then
       GdViewer1.DisplayTextEditBox(AnnotationIdx)
    End If
End Sub
//We assume that the GdViewer1 control has been properly integrated.
            
//Add the event.
GdViewer1.AnnotationAddedByUser += GdViewer1_AnnotationAddedByUser;
            
//Define the event.
void GdViewer1_AnnotationAddedByUser(int AnnotationIdx)
{
    GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(AnnotationIdx);
    annot.Author = "GdPicture";
    if (annot is GdPicture14.Annotations.AnnotationStickyNote ||
        annot is GdPicture14.Annotations.AnnotationText)
    {
        GdViewer1.DisplayTextEditBox(AnnotationIdx);
    }
}
See Also