Home : Annotations : Custom : Why doesn’t my custom annotation move when being dragged?
Q10088 - INFO: Why doesn’t my custom annotation move when being dragged?

If you create an annotation that derives from the Annotation class, the annotation may not move as expected when dragging it because the base Annotation class doesn’t contain any “move” code.  There are two ways you can handle this:

 

  1. If your annotation uses one of the AnnotationGrips classes, it’s only a matter of overriding the OnMouseDown method of the annotation and adding the following code:

    e.OverGrip = _grips.MouseDown(New Point(e.X, e.Y), Me.Parent)

    The grips will handle all of the move code.
     
  2. Override all of the mouse methods and write your own move code.  Obviously this is more involved, but the general idea is to change the Location property of the annotation based on the mouse position.

 

One way to avoid either of these is to derive your class from the FrameableAnnotation or PointsBaseAnnotation classes.  Most of the annotations in DotAnnotate derive from these two classes.
Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2017. InstantASP Ltd. All Rights Reserved