Not getting ColorLine tool click event

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

Not getting ColorLine tool click event

Post by Quant » Thu Sep 03, 2015 4:33 am

Dear Steema,
I am not getting click event for ColorLine tool. I wanna show popup on right click of ColorLine. Kindly guide me to achieve the same.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Not getting ColorLine tool click event

Post by Christopher » Thu Sep 03, 2015 8:15 am

Hello,
Quant wrote:I am not getting click event for ColorLine tool. I wanna show popup on right click of ColorLine. Kindly guide me to achieve the same.
Try:

Code: Select all

    Line series;
    ColorLine tool;
    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      series = new Line(tChart1.Chart);
      series.FillSampleValues();

      tool = new ColorLine(tChart1.Chart);
      tool.Axis = tChart1.Axes.Bottom;
      tool.Value = 5;
      tool.Pen.Color = Color.Fuchsia;
      tool.Pen.Width = 3;

      tChart1.MouseDown += TChart1_MouseDown;
    }

    private void TChart1_MouseDown(object sender, MouseEventArgs e)
    {
      if(tool.Clicked(e.Location) && e.Button == MouseButtons.Right)
      {
        MessageBox.Show("Right Click!");
      }
    }
Best Regards,
Christopher Ireland / 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

Post Reply