Page 1 of 1

Mouse position

Posted: Mon Mar 21, 2011 4:44 pm
by 13051218
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

Re: Mouse position

Posted: Tue Mar 22, 2011 11:22 am
by 10050769
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,

Re: Mouse position

Posted: Tue Mar 22, 2011 4:44 pm
by 13051218
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

Re: Mouse position

Posted: Wed Mar 23, 2011 10:11 am
by 10050769
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.