Page 1 of 1

How to reset the Scroll Values that is made active default

Posted: Wed Aug 31, 2005 4:48 pm
by 9079416
Hi

How do i reset the scroll values that is made active by selecting the right click of mouse.

I have left mouse for scroll and right mouse for scroll

After I scroll all arnd the place, and I press reset I need to return to where my graph when it loaded.

Also when i scroll my marks dont scroll with it, but the graph point does.

Posted: Thu Sep 01, 2005 10:58 am
by narcis
Hi Shawn,

Please, have a look at he example below. It does everything you request.

Code: Select all

Dim LeftMin, LeftMax, BottomMin, BottomMax As Integer
Dim AxisValuesNotSet As Boolean

Private Sub Command1_Click()
    With TChart1.Axis
        .Left.SetMinMax LeftMin, LeftMax
        .Bottom.SetMinMax BottomMin, BottomMax
    End With
End Sub

Private Sub Form_Load()
    TChart1.Series(0).FillSampleValues 10
    TChart1.Series(0).Marks.Visible = True
    
    TChart1.Zoom.Enable = False
    TChart1.Scroll.MouseButton = mbLeft
    
    AxisValuesNotSet = True
End Sub

Private Sub TChart1_OnAfterDraw()
    If AxisValuesNotSet Then
        With TChart1.Axis
            LeftMin = .Left.Minimum
            LeftMax = .Left.Maximum
            BottomMin = .Bottom.Minimum
            BottomMax = .Bottom.Maximum
        End With
        AxisValuesNotSet = False
    End If
End Sub
How do i reset the scroll values that is made active by selecting the right click of mouse.
Please see TChart1_OnAfterDraw and Command1_Click events code.
I have left mouse for scroll and right mouse for scroll
Left mouse button default function is zooming, to let scroll with that button we first have to assign zoom another button or disable it, see Form_Load.
Also when i scroll my marks dont scroll with it, but the graph point does.
Adding a TChart, a series and a button in a form and using the code above, marks are also scrolled. Could you please post an example where marks are not scrolled so that we can reproduce the problem here?