Hello........
I am using different types of Annotations on ultra chart. Now I want to drag these Annotations at different
locations as enduser needs.
Whenever I try to drag any of the annotations, only one specific annotation (which was added first ) is
dragging. How can I identify that which Annotation has been selected by the user ?
i am using this code :
public override bool CanStart() { foreach (Annotation annotation in this.UltraChart.Annotations.Annotations) {
//Box Annotation BoxAnnotation boxAnnotation = annotation as BoxAnnotation; if (boxAnnotation == null) continue;
Point pt = new Point((int)boxAnnotation.Location.LocationX, (int)boxAnnotation.Location.LocationY); Size size = boxAnnotation.GetBoxSize();
pt.X -= size.Width / 2; pt.Y -= size.Height / 2;
Rectangle rect = new Rectangle(pt, size);
if (rect.Contains(this.LastInput.ViewPoint) == false) return false;
this.draggingAnnotation = boxAnnotation;
this.prevPoint = this.LastInput.ViewPoint;
// EllipseAnnotation
EllipseAnnotation _ellipseAnnotation = annotation as EllipseAnnotation; if (_ellipseAnnotation == null) continue;
Ellipse _ellipse = new Ellipse(new Point((int)_ellipseAnnotation.Location.LocationX), new Point((int)_ellipseAnnotation.Location.LocationY));
// Rectangle rect = new Rectangle(pt, size);
//if (rect.Contains(this.LastInput.ViewPoint) == false) // return false;
this.draggingAnnotation = _ellipseAnnotation;
}
Thanks
Dilip Natani
http://forums.infragistics.com/forums/p/9701/37617.aspx#37617
ok it works.....but how it is work in case of another annotations like EllipseAnnotation,lineAnnotations.
Unfortunately, we don’t have method in the annotations, which provides information whether some point is within the annotation. If you want to request this as an official feature then please visit this page: http://devcenter.infragistics.com/protected/requestfeature.aspx