Automatically editing text on creation

Discussions about annotation support.
Post Reply
richm
Posts: 1
Joined: Thu Apr 05, 2012 1:52 pm

Automatically editing text on creation

Post by richm » Thu Apr 05, 2012 2:28 pm

If I use the samples\Bin\Annotation.exe and create a text annotation, the text 'APPROVED by John Smith' is automatically selected and the annotation is in edit mode.

However if I use the source to this, presumably samples\AnyCPU\C#\Annotations\Csharp-Annotations.csproj and do the same thing the text is not selected and the user must double click the annotation to edit.

How do I make c# demo behave like the compiled version?

Thanks.

Richard.

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

Re: Automatically editing text on creation

Post by Loïc » Thu Apr 05, 2012 5:47 pm

Hello,

You have to intercept the AnnotationAddedByUser event and than call the DisplayTextEditBox by using the AnnotationIdx parameter.

VB.NET

Code: Select all

Private Sub GdViewer1_AnnotationAddedByUser(ByVal AnnotationIdx As Integer) Handles GdViewer1.AnnotationAddedByUser
    GdViewer1.DisplayTextEditBox(AnnotationIdx)
End Sub

C#

Code: Select all

 private void GdViewer1_AnnotationAddedByUser(int AnnotationIdx)
{
    GdViewer1.DisplayTextEditBox(AnnotationIdx);
}
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 1 guest