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
Textannotation show textbox automaticly
Moderator: Alex
-
- Posts: 17
- Joined: Mon Jan 03, 2011 2:45 pm
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Textannotation show textbox automaticly
Hello Michael,
Yes, you can show text box associated with annotation automatically when annotation is finished building.
Here is a snippet of code:
Best regards, Alexander
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);
}
}
-
- Posts: 17
- Joined: Mon Jan 03, 2011 2:45 pm
Re: Textannotation show textbox automaticly
Hello Alexander,
thank you for you reply.
The code work as I aspected.
I extended it with the location of the textannotation
Otherwise the textbox appear on location (0,0).
Best
Regards
Michael
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))
Best
Regards
Michael