How to reset the Scroll Values that is made active default

TeeChart for ActiveX, COM and ASP
Post Reply
Shawn
Newbie
Newbie
Posts: 10
Joined: Fri Nov 15, 2002 12:00 am

How to reset the Scroll Values that is made active default

Post by Shawn » Wed Aug 31, 2005 4:48 pm

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.

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

Post by Narcís » Thu Sep 01, 2005 10:58 am

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