Hi,
I would like to detect when the user's mouse is over a ColorLine, or when click it to show a tooltip. But I only found EndDragLine and DragLine, and I don't want the user move it to show the tooltip. Any Ideas?
Thanks
ColorLine onMouseOver/onClick event?
Re: ColorLine onMouseOver/onClick event?
Hi wakeup,
Have you tried with the MouseMove event with the tool clicked method?
It seems that the colorline clicked method doesn't return the correct value, that's I used "(Math.Abs(e.X - colorline1.Axis.CalcPosValue(colorline1.Value)) == colorline1.ColorLineClickTolerance)" instead of it. Could you please confirm that the clicked method doesn't work as expected?
Have you tried with the MouseMove event with the tool clicked method?
Code: Select all
Steema.TeeChart.Tools.ColorLine colorline1;
Steema.TeeChart.Tools.Annotation annotation1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
colorline1 = new Steema.TeeChart.Tools.ColorLine(tChart1.Chart);
colorline1.Axis = tChart1.Axes.Bottom;
colorline1.Value = 10;
annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
annotation1.Active = false;
colorline1.ColorLineClickTolerance = 5;
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
}
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
if /*(colorline1.Clicked(e.X, e.Y))*/ (Math.Abs(e.X - colorline1.Axis.CalcPosValue(colorline1.Value)) == colorline1.ColorLineClickTolerance)
{
annotation1.Text = "colorline1 value: " + colorline1.Value.ToString();
annotation1.Top = e.Y;
annotation1.Left = e.X;
annotation1.Active = true;
tChart1.Refresh();
}
else annotation1.Active = false;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: ColorLine onMouseOver/onClick event?
Sorry. My the type of my chart.MouseMove is EventHandler and not MouseEventHandler. So I can't get e.X, e.Y values...
What have I different? I'm woring with Visual studio 2008 and the the last version of teechart.net
Thanks
What have I different? I'm woring with Visual studio 2008 and the the last version of teechart.net
Thanks
Re: ColorLine onMouseOver/onClick event?
Hi wakeup,
Are you programming on C++? Here, creating the event at designtime it looks as follows:
Are you programming on C++? Here, creating the event at designtime it looks as follows:
Code: Select all
this->tChart1->MouseMove += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::tChart1_MouseMove);
//...
private: System::Void tChart1_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: ColorLine onMouseOver/onClick event?
No, I'm programming in C#
thanks!
thanks!
Re: ColorLine onMouseOver/onClick event?
Hi wakeup,
It's strange. Have you tried the code I posted above in a new testing WinForms project (File\New\Project...\Visual C#\Windows Forms Application)?
It's strange. Have you tried the code I posted above in a new testing WinForms project (File\New\Project...\Visual C#\Windows Forms Application)?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: ColorLine onMouseOver/onClick event?
Oh! Sorry. I was using the mouseOver event instead of mouseMove. Now it runs.
But it doen't run with the colorline1.Clicked condition
But it doen't run with the colorline1.Clicked condition
Re: ColorLine onMouseOver/onClick event?
Hi wakeup,
Thanks, I've added it to the defect list to be fixed in future releases (TF02014736).
Thanks, I've added it to the defect list to be fixed in future releases (TF02014736).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |