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:
- 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.
- 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.