Programmatically calling axis arrow events

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
johnnyboyc
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am

Programmatically calling axis arrow events

Post by johnnyboyc » Tue Feb 17, 2004 4:46 pm

I'd like to incorporate mousewheel scrolling in my 2D-charts, so I thought a nice way of doing it would be to capture the mousewheel event, then depending on the delta position of the mouse, scroll the graph accordingly. To simplify this (in my mind anyway!) I then realised that 'tapping into' the axis arrow scrolling events would be an ideal way of controlling the degree of scrolling.

Is there a way I can programmatically scroll the graph via the axis arrows?

Marc
Site Admin
Site Admin
Posts: 1217
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Thu Feb 19, 2004 12:56 pm

Hello,

You could bypass the Axis Arrows completely. The following would achieve the scrolling result:

Decide on an interval you'd like for scroll per mousewheel notch (here 20)...

eg.

Code: Select all

    Private Sub Form1_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseWheel
        Dim interval As Int32
        interval = 20
        With TChart1.Axes.Bottom
            If e.Delta < 0 Then
                .SetMinMax(.Minimum - interval, .Maximum - interval)
            Else
                .SetMinMax(.Minimum + interval, .Maximum + interval)
            End If
        End With
    End Sub
I hope that code may prove of service.

Regards,
Marc Meumann
Steema Support

Post Reply