Results 1 to 6 of 6

Thread: [RESOLVED] VBAccelerator Scrollbar Class Issue

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Resolved [RESOLVED] VBAccelerator Scrollbar Class Issue

    I am trying to use VBAccelerator Scrollbar class to scroll picture in picturebox. But I have a Max Thumb position Issue ,which either is related to my code or this scrollbar class.

    For example:
    My picturebox's ScaleWidth is 600 pixels,the picture has 1000 pixels width.

    Code:
            m_HVScroll.Visible(efsHorizontal) = True
            m_HVScroll.Min(efsHorizontal) = 0
            m_HVScroll.LargeChange(efsHorizontal) = 600 'equal to picture1.ScaleWidth
            m_HVScroll.Max(efsHorizontal) = 1000-600     'Maximum available movement
            m_HVScroll.SmallChange(efsHorizontal) = 10   'click button to move 10 pixels
    If I fast move the Thumb, the debug window show the m_HVScroll.Value(efsHorizontal) = 401.
    If I click the Right button, the Value change to 400, I can see the scrollbat stepping backward 1 pixel.

    Those are not what I want. I need m_HVScroll.Value(efsHorizontal)= 400 at the end.

    In Class, I saw tSI.nTrackPos = 401 (Note: or HiWord of wParam). How to prevent max limit in the subclass of WM_HSCROLL?

    I attach the class.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by Jonney; Apr 27th, 2014 at 04:09 AM.

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: VBAccelerator Scrollbar Value > Max Issue

    I find another demo on VBAccelerator. Obviously, the scrollbar has exactly the same problem. That means the original class has the problem instead of my code. Can anyone fix it? Thanks in advance.

    FYI, I remembered the great sGrid2 scrollbar also had the same problem.

    I attach the demo.

    [Edited] in frmScrollDemo3, put debug.print in code:

    Code:
    Private Sub m_cScroll_Change(eBar As EFSScrollBarConstants)
            Debug.Print m_cScroll.Value(efsHorizontal), m_cScroll.Max(efsHorizontal), m_cScroll.LargeChange(efsHorizontal),   m_cScroll.SmallChange(efsHorizontal)
           m_cScroll_Scroll eBar
    End Sub
    Fast moving Horizontal scrollbar to the end, the Value is bigger than Max by 1 pixel:

    502 501 250 48
    Attached Files Attached Files
    Last edited by Jonney; Apr 27th, 2014 at 04:30 AM.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: VBAccelerator Scrollbar Class Issue

    The Scrollbar Class is very straight forward. I have no idea why nTrackPos or HiWord(wParam) exceeds Max value. Please help.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: VBAccelerator Scrollbar Class Issue

    Even though the problem is small, but it's very annoying...

  5. #5
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,454

    Re: [RESOLVED] VBAccelerator Scrollbar Class Issue

    Took a look now and found, that the calculation for the Max-Member of the SBInfo-Struct was off by one...
    Also changed the behaviour to being fully compatible to the Min/Max/LargeChange-behaviour of the VB6-Scrollers.

    Below is a reduced example of the original Zip you provided, which allows shifting the same
    Client-Picture with both Scroller-approaches - either per API-Scrollers or alternatively with the normal VB-Scrollers.

    http://vbRichClient.com/Downloads/VB...onstration.zip

    Olaf

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: [RESOLVED] VBAccelerator Scrollbar Class Issue

    Quote Originally Posted by Schmidt View Post
    Took a look now and found, that the calculation for the Max-Member of the SBInfo-Struct was off by one...
    Also changed the behaviour to being fully compatible to the Min/Max/LargeChange-behaviour of the VB6-Scrollers.

    Below is a reduced example of the original Zip you provided, which allows shifting the same
    Client-Picture with both Scroller-approaches - either per API-Scrollers or alternatively with the normal VB-Scrollers.

    http://vbRichClient.com/Downloads/VB...onstration.zip

    Olaf
    True. Have to offset -1 in Max calculation and put checking code in Value calculation.

    Thank you Schmidt. VbForums is a great community.


    @Schmidt
    Last edited by Jonney; Apr 29th, 2014 at 05:07 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width