Page 1 of 1

Programmatically calling axis arrow events

Posted: Tue Feb 17, 2004 4:46 pm
by 8121980
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?

Posted: Thu Feb 19, 2004 12:56 pm
by Marc
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