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 » Tue Jan 31, 2012 8:37 am

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: 1445
Joined: Thu Jul 10, 2008 2:21 pm

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

Post by Alex » Tue Jan 31, 2012 11:04 am

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 » Mon Feb 06, 2012 10:30 am

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: 1445
Joined: Thu Jul 10, 2008 2:21 pm

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

Post by Alex » Mon Feb 06, 2012 11:40 am

Hello Jun,

It is the possible solution but not the best.

Why have you not used the SelectedAnnotation property?

Best regards, Alexander

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest