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.
If I fast move the Thumb, the debug window show the m_HVScroll.Value(efsHorizontal) = 401.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 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.




Reply With Quote