I want to show a text whenever the user points to a particular bar (say bar 4 of 20 bars in a bar chart) with the mouse.
In old VB the code would be: Histogram1.Series(i).GetMousePoint. This would return the ref. to the bar - with would this be translated into in VB.NET ?
Referrence to chosen bar on MouseMove event in VB.NET
-
- Newbie
- Posts: 61
- Joined: Wed Jun 22, 2005 4:00 am
- Location: cph
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ext-cph,
Which TeeChart version are you using? TeeChart for .NET v1 includes VB.NET examples at the ASP.NET Server Examples. TeeChart for .NET v2 includes a live demo, also available at http://www.steema.net/TeeChartForNET/index.aspx , which includes several examples. If you have any trouble translating C# code to VB.NET you may try using http://www.kamalpatel.net/ConvertCSharp2VB.aspx .
Which TeeChart version are you using? TeeChart for .NET v1 includes VB.NET examples at the ASP.NET Server Examples. TeeChart for .NET v2 includes a live demo, also available at http://www.steema.net/TeeChartForNET/index.aspx , which includes several examples. If you have any trouble translating C# code to VB.NET you may try using http://www.kamalpatel.net/ConvertCSharp2VB.aspx .
Best Regards,
Narcís Calvet / 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 |
-
- Newbie
- Posts: 61
- Joined: Wed Jun 22, 2005 4:00 am
- Location: cph
Not quite what I wanted!
The example is not exactly what I am looking for!
I am using the .NET v.2 and is missing a method for retrieving the number of the bar the mouse is pointing at. Like the 'old' VB way to do this: Histogram1.Series(i).GetMousePoint. Here GetMousePoint did exactly that - returning the number of the bar in the series.
What is the proper way in my MouseMove event to do this?
I am using the .NET v.2 and is missing a method for retrieving the number of the bar the mouse is pointing at. Like the 'old' VB way to do this: Histogram1.Series(i).GetMousePoint. Here GetMousePoint did exactly that - returning the number of the bar in the series.
What is the proper way in my MouseMove event to do this?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi ext-cph,
The solution should be code below but I've seen it doesn't work for Histogram series. I have added it to our defect list to be fixed for next releases. However you could use it for other series types.
The solution should be code below but I've seen it doesn't work for Histogram series. I have added it to our defect list to be fixed for next releases. However you could use it for other series types.
Code: Select all
Private Sub TChart1_MouseMove1(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TChart1.MouseMove
Dim Index As Integer
Index = TChart1.Series(0).Clicked(e.X, e.Y)
If Index <> -1 Then
TChart1.Header.Text = "Bar num.: " + (Index + 1).ToString()
End If
End Sub
Best Regards,
Narcís Calvet / 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 |