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?
Programmatically calling axis arrow events
-
- Newbie
- Posts: 6
- Joined: Fri Nov 15, 2002 12:00 am
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.
I hope that code may prove of service.
Regards,
Marc Meumann
Steema Support
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
Regards,
Marc Meumann
Steema Support