Greetings,
Is there a way to determine if you currently have selected a handle on the drawline and in particular WHICH handle you have under the mouse ...
I suppose I could grab the mouse coords -- convert them to price and index values and then see whether they fall close enough to say yep .. thats the StartPos end of the Line ...
Is there a more bullet proof way of knowing what end of the tiger one currently has hold of
P.S. hey how come I'm still a "newbie" ... I would think by now I'm an intermediate at asking formum questions .... maybe I need to upload more pictures
DRawLine Handles can I detect whether I've got hold of one.
DRawLine Handles can I detect whether I've got hold of one.
--------------------
Cheers Phil.
Cheers Phil.
Re: DRawLine Handles can I detect whether I've got hold of one.
Hello Phil,
I suggest you use MouseClickEvent or MouseDownEvent or MouseMoveEvent and DrawLineItems as do in next example to calculated StartPos and EndPos of DrawLine Tool.
Could you tell us if previous code works as you want?
I hope will helps.
Thanks,
I suggest you use MouseClickEvent or MouseDownEvent or MouseMoveEvent and DrawLineItems as do in next example to calculated StartPos and EndPos of DrawLine Tool.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Candle candle1 = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
candle1.FillSampleValues();
Steema.TeeChart.Tools.DrawLine drawline = new Steema.TeeChart.Tools.DrawLine(tChart1.Chart);
drawline.Pen.Color = Color.Red;
drawline.Pen.Width = 2;
drawline.EnableDraw = true;
tChart1.Axes.Bottom.Labels.Angle = 90;
tChart1.MouseClick += new MouseEventHandler(tChart1_MouseClick);
}
void tChart1_MouseClick(object sender, MouseEventArgs e)
{
Steema.TeeChart.Tools.DrawLineItem drawlineItems = (tChart1.Tools[0] as Steema.TeeChart.Tools.DrawLine).Clicked(e.X, e.Y);
if (drawlineItems != null)
{
if (drawlineItems.StartHandle.Contains(e.X, e.Y))
{
this.Text = "Start Handle X value: " + (DateTime.FromOADate(drawlineItems.StartPos.X)).ToShortDateString() + "Start Handle Y value: " + ((int)drawlineItems.StartPos.Y).ToString();
}
else if (drawlineItems.EndHandle.Contains(e.X, e.Y))
{
this.Text = "Start Handle X value: " + (DateTime.FromOADate(drawlineItems.EndPos.X)).ToShortDateString() + "Start Handle Y value: " + ((int)drawlineItems.EndPos.Y).ToString();
}
}
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: DRawLine Handles can I detect whether I've got hold of one.
Hi Phil,
You need 100 posts to get "Advanced" user rank and one thousand for "Guru". We might consider adding intermediate ranks .P.S. hey how come I'm still a "newbie" ... I would think by now I'm an intermediate at asking formum questions .... maybe I need to upload more pictures
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |