CustomAnnotation - don't want to select annot. after draw

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

Moderator: Alex

Post Reply
Junhui
Posts: 8
Joined: Wed Jan 18, 2012 10:22 am

CustomAnnotation - don't want to select annot. after draw

Post by Junhui »

I've made custom annotation class which overrides LinesAnnotation.
After drawing that annotation(customed) on annotationviewer, it selected automatically.
I want to select custom annotation manually, but not select automatically after drawing.
Can I do that with OnFinishBuilding(System.Drawing.PointF point)? Or anotherway?

class MyLineAnnotation : LinesAnnotation
{
protected override void OnBuilding(MouseEventArgs e, MouseActions action)
{
... ...
}

protected override void OnFinishBuilding(System.Drawing.PointF point)
{
base.OnFinishBuilding(point);
// how can I reach the goal...
}
}

Best Regards,
Jun Hee.
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: CustomAnnotation - don't want to select annot. after dra

Post by Alex »

Hello Jun,

You can set the selected annotation in the annotation viewer using the SelectedAnnotation property of the AnnotationViewer.

Best regards, Alexander
Junhui
Posts: 8
Joined: Wed Jan 18, 2012 10:22 am

Re: CustomAnnotation - don't want to select annot. after dra

Post by Junhui »

I handled this issue with codes below,

[DllImport("user32.dll")]
public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtaInfo);

and I generated 'mouse_event(0x8 | 0x10, 0, 0, 0, 0);' after draw.

Best regards,
Jun Hee.
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: CustomAnnotation - don't want to select annot. after dra

Post by Alex »

Hello Jun,

It is the possible solution but not the best.

Why have you not used the SelectedAnnotation property?

Best regards, Alexander
Post Reply