Referrence to chosen bar on MouseMove event in VB.NET

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

Referrence to chosen bar on MouseMove event in VB.NET

Post by Lars Iversen » Mon Jul 11, 2005 9:36 am

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 ?

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

Post by Narcís » Mon Jul 11, 2005 9:54 am

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 .
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

Lars Iversen
Newbie
Newbie
Posts: 61
Joined: Wed Jun 22, 2005 4:00 am
Location: cph

Not quite what I wanted!

Post by Lars Iversen » Mon Jul 11, 2005 11:26 am

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?

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

Post by Narcís » Tue Jul 12, 2005 8:04 am

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.

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

Post Reply