DrawLine Tool clicked event

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

DrawLine Tool clicked event

Post by amol » Tue Jan 27, 2015 9:46 am

Hi Steema Support,

How to get DrawLine Tool doubleclicked event. Or we can say How to get DrawLine Tool doubleclicked.

Thanks in advance.

Thanks&Regards
PlanoResearch

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: DrawLine Tool clicked event

Post by Narcís » Thu Jan 29, 2015 8:49 am

Hi PlanoResearch,

DoubleClick event is not implemented for the DrawLine tool. However, you can easily implement it combining TChart's MouseDown and DoubleClick events as in the code snippet below.

Code: Select all

    public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;

      FastLine fastLine1 = new FastLine(tChart1.Chart);
      fastLine1.FillSampleValues();

      drawLine1 = new Steema.TeeChart.Tools.DrawLine(tChart1.Chart);
      tChart1.DoubleClick += tChart1_DoubleClick;
      tChart1.MouseDown += tChart1_MouseDown;

    }

    private Steema.TeeChart.Tools.DrawLine drawLine1;
    private Point mousePos;

    void tChart1_MouseDown(object sender, MouseEventArgs e)
    {
      mousePos = new Point(e.X, e.Y);
    }

    void tChart1_DoubleClick(object sender, EventArgs e)
    {
      if (!mousePos.IsEmpty)
      {
        Steema.TeeChart.Tools.DrawLineItem dli = drawLine1.Clicked(mousePos.X, mousePos.Y);
      }
    }
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply