Page 1 of 1

Drawlines Tool

Posted: Thu Aug 03, 2006 9:22 am
by 9530819
Hi

I need to be able to remove the drawhandles from a drawline tool programatically. Is this possible?

Also, I have drawlines that I have labeled with the annotation tool. Is it possible to have the annotations move with the drawline when I scroll the chart?

Regards,
Ross

Posted: Thu Aug 03, 2006 11:23 am
by 9531990
Hello Rossmc,

to the first part of your question:
I need to be able to remove the drawhandles from a drawline tool programatically. Is this possible?
try this:

Code: Select all

TChart1.Tools.Items(0).asDrawLine.AddLine -1000, -1000, -1000, -1000
TChart1.Tools.Items(0).asDrawLine.Selected = 0
The idea is to draw a invisible line out of chart and you set the focus on this invisible line, after drawing.


For the second part of your question:

Code: Select all

With TChart1.Tools.Items(0).asDrawLine
     .Lines.Items(.Lines.Count - 1).EndPos.X = TChart1.Axis.Bottom.CalcPosPoint(TChart1.Tools.Items(1).asAnnotation.Left)
     .Lines.Items(.Lines.Count - 1).EndPos.Y = TChart1.Axis.Left.CalcPosPoint(TChart1.Tools.Items(1).asAnnotation.Top)
  End With
  TChart1.Repaint
Use annotation property "bound" to move with the cursor.[/quote]