Mouse position

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Yacu
Newbie
Newbie
Posts: 31
Joined: Tue Dec 23, 2008 12:00 am

Mouse position

Post by Yacu » Mon Mar 21, 2011 4:44 pm

I am trying to reprogram some basic capabilities of an old VB6 program.
I have not been able to find the .NET equivalent of this routine concerning mouse coordinates on a datetime formatted axis.
Can you help me to find it?. Thanks in advance

Private Sub TChart1_OnDblClick()
tmp = 0
TChart1.ToolTipText = ""
tmp = TChart1.Series(3).GetMousePoint
If tmp > -1 Then
xscr = TChart1.Series(3).CalcXPos(tmp)
xv = Format(TChart1.Series(3).XScreenToValue(xscr), "dd/mm/yyyy")
Text1.Text = xv
End If
End Sub

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Mouse position

Post by Sandra » Tue Mar 22, 2011 11:22 am

Hello Yacu,
I think you can do something as next code:

Code: Select all

        Steema.TeeChart.Styles.Bar series1;
        private void InitializeChart()
        {
            series1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            series1.XValues.DateTime = true;
            series1.FillSampleValues();
            tChart1.MouseDoubleClick += new MouseEventHandler(tChart1_MouseDoubleClick);
        }

        void tChart1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            textBox1.Text= DateTime.FromOADate(series1.XScreenToValue(e.X)).ToShortDateString();
        }
Could you tell us, if previous code works as you expected?

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Yacu
Newbie
Newbie
Posts: 31
Joined: Tue Dec 23, 2008 12:00 am

Re: Mouse position

Post by Yacu » Tue Mar 22, 2011 4:44 pm

Thanks, Sandra, it works perfectly.

By the way, I'm encountering this type of problem (using new .NET commands and finding the .NET equivalents of VB6 code) almost everyday and I spend too much time finding simple solutions. I wonder if there is a more complete documentation on the class properties and events other than the chm files and the VB sample you pack with the control. Please let me know

Thank you in advance

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Mouse position

Post by Sandra » Wed Mar 23, 2011 10:11 am

Hello Yacu,
I recommend you take a look in:

- TeeChart for .Net Help files.
- TeeChart for .Net Tutorials
- Demo project.


In this files you can find more information of methods, Events and completed examples of Teechart for .Net

I hope will helps.
Best Regards,
Sandra Pazos / 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