Change Text @ TextAnnotation

Discussions about annotation support.
Post Reply
Ibbe
Posts: 3
Joined: Tue May 17, 2011 11:57 am

Change Text @ TextAnnotation

Post by Ibbe » Mon Aug 01, 2011 9:54 am

Hi,

How can a user change the text of a TextAnnotation?

Kind Regards
Ibbe

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Change Text @ TextAnnotation

Post by Loïc » Tue Aug 02, 2011 2:25 am

Hi,

You can change the text through the Text property of the text annotation.

Here an example which changes the text of the selected annotation, if it is a TextAnnotation:

Code: Select all

      Dim annot_idx As Integer = GdViewer1.GetSelectedAnnotationIdx()
      If annot_idx <> -1 Then
         Dim annot As GdPicture.Annotation = GdViewer1.GetAnnotationFromIdx(annot_idx)
         If annot.GetAnnotationType = GdPicture.Annotation.GdPictureAnnotationType.AnnotationTypeText Then
            Dim text_annot As AnnotationText = CType(annot, AnnotationText)

            text_annot.Text = "Here the new text"
         End If
      End If
Let me know if you need further information.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests