Textannotation show textbox automaticly

Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.

Moderator: Alex

Post Reply
MichaelHerrmanns
Posts: 17
Joined: Mon Jan 03, 2011 2:45 pm

Textannotation show textbox automaticly

Post by MichaelHerrmanns » Tue Jan 24, 2012 11:26 pm

Hello Alexander,

is there a possibility to show the textbox of an textannotion automaticly after the annotation is finished building?
I try same things but without success.

Best regards

Michael

Alex
Site Admin
Posts: 1443
Joined: Thu Jul 10, 2008 2:21 pm

Re: Textannotation show textbox automaticly

Post by Alex » Thu Jan 26, 2012 1:16 pm

Hello Michael,

Yes, you can show text box associated with annotation automatically when annotation is finished building.

Here is a snippet of code:

Code: Select all

private void annotationViewer1_AnnotationBuildingFinished(object sender, EventArgs e)
{
    AnnotationBase anno = annotationViewer1.SelectedAnnotation;
    TextAnnotation textAnno = anno as TextAnnotation;
    if (textAnno != null)
    {
        annotationViewer1.Controls.Add(textAnno.TextBox);
    }
}
Best regards, Alexander

MichaelHerrmanns
Posts: 17
Joined: Mon Jan 03, 2011 2:45 pm

Re: Textannotation show textbox automaticly

Post by MichaelHerrmanns » Thu Jan 26, 2012 5:01 pm

Hello Alexander,

thank you for you reply.
The code work as I aspected.
I extended it with the location of the textannotation

Code: Select all

textAnno.TextBox.Location = New Point(CInt(textAnno.Location.X), CInt(textAnno.Location.Y))
Otherwise the textbox appear on location (0,0).

Best

Regards

Michael

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest