Page 1 of 1

Not getting ColorLine tool click event

Posted: Thu Sep 03, 2015 4:33 am
by 16071129
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.

Re: Not getting ColorLine tool click event

Posted: Thu Sep 03, 2015 8:15 am
by Christopher
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!");
      }
    }