Example





In This Topic
GdPicture14 Namespace / GdViewer Class / AnnotationEndEditingText Event

AnnotationEndEditingText Event (GdViewer)

In This Topic
This event is raised when the user has finished editing the content of the sticky note or text GdPicture/XMP annotations by leaving the editable dialogue box.

Please check the corresponded GdViewer.AnnotationEndEditingTextEventHandler for given parameters.

Syntax
'Declaration
 
Public Event AnnotationEndEditingText As GdViewer.AnnotationEndEditingTextEventHandler
public event GdViewer.AnnotationEndEditingTextEventHandler AnnotationEndEditingText
public event AnnotationEndEditingText: GdViewer.AnnotationEndEditingTextEventHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.AnnotationEndEditingTextEventHandler* AnnotationEndEditingText
public:
event GdViewer.AnnotationEndEditingTextEventHandler^ AnnotationEndEditingText
Remarks
Be aware, that this event only handles GdPicture/XMP annotations, specifically sticky note and text annotations.
Example
How to add this event to your GdViewer control and use it for getting the annotation content after editing.
'We assume that the GdViewer1 control has been properly integrated.
Friend WithEvents GdViewer1 As GdPicture14.GdViewer
            
'Add the event.
AddHandler GdViewer1.AnnotationEndEditingText, AddressOf GdViewer1_AnnotationEndEditingText
            
'Define the event.
Sub GdViewer1_AnnotationEndEditingText(ByVal AnnotationIdx As Integer) Handles GdViewer1.AnnotationEndEditingText
    Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(AnnotationIdx)
    Dim text As String = ""
    If TypeOf annot Is GdPicture14.Annotations.AnnotationStickyNote Then
        text = (CType(annot, GdPicture14.Annotations.AnnotationStickyNote)).Text
    ElseIf TypeOf annot Is GdPicture14.Annotations.AnnotationText Then
        text = (CType(annot, GdPicture14.Annotations.AnnotationText)).Text
    End If
    MessageBox.Show(text, "GdViewer.AnnotationEndEditingText")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
            
//Add the event.
GdViewer1.AnnotationEndEditingText += GdViewer1_AnnotationEndEditingText;
            
//Define the event.
void GdViewer1_AnnotationEndEditingText(int AnnotationIdx)
{
    GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(AnnotationIdx);
    string text = "";
    if (annot is GdPicture14.Annotations.AnnotationStickyNote)
        text = ((GdPicture14.Annotations.AnnotationStickyNote)annot).Text;
    else if (annot is GdPicture14.Annotations.AnnotationText)
        text = ((GdPicture14.Annotations.AnnotationText)annot).Text;
    MessageBox.Show(text, "GdViewer.AnnotationEndEditingText");
}
See Also