Autor Tema: VBAccelerator's Scrollbar class issue  (Leído 1185 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
VBAccelerator's Scrollbar class issue
« en: Abril 28, 2014, 05:15:17 am »
I am trying to use VBAccelerator Scrollbar class to scroll picture in picturebox. But I noticed the thumb position exceed MAX value by 1 pixes.

For example:
My picturebox's ScaleWidth is 600 pixels,the picture has 1000 pixels width.
Código: [Seleccionar]
        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 moving the Thumb to the right end, the debug window shows 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 because Max is 400.

I found another demo on VBAccelerator. Obviously, the scrollbar has exactly the same problem. That means the original class has the problem instead of my code.

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

Even though the problem is small, but quite annoying...


Attachment:
http://www.vbforums.com/attachment.php?attachmentid=113339&d=1398582988

cobein

  • Moderador Global
  • Gigabyte
  • *****
  • Mensajes: 348
  • Reputación: +63/-0
  • Más Argentino que el morcipan
    • Ver Perfil
Re:VBAccelerator's Scrollbar class issue
« Respuesta #1 en: Abril 28, 2014, 11:49:41 am »
Jen, vbaccelerator have a full picturebox scroll example  on its site.

http://www.vbaccelerator.com/home/VB/Code/Controls/Scroll_Bars/article.asp

Jen

  • Kilobyte
  • **
  • Mensajes: 54
  • Reputación: +2/-0
    • Ver Perfil
Re:VBAccelerator's Scrollbar class issue
« Respuesta #2 en: Abril 28, 2014, 09:05:37 pm »
VBAccelerator is the best side for advance stuff. But I found nothing regarding the scrollbar's bugs. After debugging, I put offset -1 in MAX calculation and checking codes in Value calculation. Problem resolved.

The fix is here: http://www.vbforums.com/showthread.php?762497-RESOLVED-VBAccelerator-Scrollbar-Class-Issue&p=4663499&viewfull=1#post4663499
« última modificación: Abril 29, 2014, 07:11:23 pm por Jen »