dcsimg
Results 1 to 15 of 15

Thread: [VB6] Smooth Scrollbar Control v1.0.9b (updated 11/12/19)

  1. #1

    Thread Starter
    Member shagratt's Avatar
    Join Date
    Jul 2019
    Posts
    61

    Lightbulb [VB6] Smooth Scrollbar Control v1.0.9b (updated 11/12/19)

    I make some modifications to Carles P.V. scrollbars to adapt it to one of my projects.
    Its a Usercontrol Scrollbar that change its value incrementally to the desired value (.ScrollToValue(xx)) creating a smooth transition. It works much like web pages scrollbars. Also it has native mousewheel support.


    Name:  UCScrollBar_snapw7.png
Views: 128
Size:  13.5 KB

    * 1.0.6: (Shagratt)
    - Added MouseWhell support on Hover (no focus needed)
    - Added MouseWhell support over another object (on demand by hWnd)
    - Added Public Methods to create object on demand (by code)
    - Added Smooth Scrolling (can be adjusted.value=1 Disabled)
    - MouseWheel scroll value can be adjusted
    - Changed Thumb size formula (based on LargeChange)
    - Continous TL/BR button scrolling
    - Changed default props: Flat, scroll rates,etc.
    - Updated to Paul Caton Self Sub v1.6

    * 1.0.7:
    - Changed dragging thumb to smooth scroll instead of direct to value (smooth drawing too)
    Thanks dseaman@vbforums for the idea!

    * 1.0.7b:
    - Changed dragging to smooth scroll instead of direct to value (smooth thumb and value)

    * 1.0.8:
    - Changed dragging the thumb is direct visually (only value change smooth)
    - Fixed lot of errors on thumb draws/calculation introduced in 1.0.7b
    - Minor fixes added

    * 1.0.9:
    - Fixed Themed Style
    - Change Themed hover on arrows to emphasize both buttons

    * 1.0.9b:
    - Fixed thumb formula when value to scroll was too small (finally!)
    - Exposed ZOrder


    Dowload : prj (Ctrl) Smooth ScrollBar.v1.0.9b.zip


    Credits to: Carles P.V., Jason James Newland, Paul Caton, James Brown.

  2. #2
    Addicted Member
    Join Date
    Aug 2016
    Posts
    191

    Re: [VB6] Smooth Scrollbar Control

    I pay tribute to Carles P.V. because he wrote many ready-to-use and neat & clean codes. Thank him!
    There're a bug in pvCheckEnvironment or pvDrawThemePart. I think Shagratt you can fix it.
    Last edited by DaveDavis; Dec 5th, 2019 at 09:45 PM.

  3. #3
    Addicted Member
    Join Date
    Aug 2016
    Posts
    191

    Re: [VB6] Smooth Scrollbar Control

    I play your code, not yet go through.
    1) HScrollbar move to end, A partial of blue square is covered by vertical scrollbar. Is your demo math problem or ucScrollbar problem?
    2) When fast scrolling HScrollbar, the blue square draw obviously slower than scrolling VScrollbar.
    Attached Images Attached Images  

  4. #4

    Thread Starter
    Member shagratt's Avatar
    Join Date
    Jul 2019
    Posts
    61

    Re: [VB6] Smooth Scrollbar Control

    First thanks for the feedback!
    1) I made a really simple example so people can understand how to tune/use the scrollbar... the position calculation of the box dont have checks so its probably a problem in the formula. For the real values of the scrollbar see the caption. The values seems to be ok.
    2) Not sure to understand this... but perhaps has something to do with me using the same max values for vertical than horizontal instead of using a bigger horizontal value.

    I'm doing right now another control (almost finished) that use the scrollbars and have a way better and complex example.

  5. #5

    Thread Starter
    Member shagratt's Avatar
    Join Date
    Jul 2019
    Posts
    61

    Re: [VB6] Smooth Scrollbar Control

    Quote Originally Posted by DaveDavis View Post
    I pay tribute to Carles P.V. because he wrote many ready-to-use and neat & clean codes. Thank him!
    There're a bug in pvCheckEnvironment or pvDrawThemePart. I think Shagratt you can fix it.
    Mmm... I tested it on two Windows 7 (32 and 64bits) and Windows 10 (64b) ... Cant see any bug. Only tested the flatbar/normal mode.
    Exactly what you did to found the bug? I will try to fix it but honestly now I'm in the 'all flat' style so if something is broken with the theming probably will comment all the code and strip that option.

  6. #6
    Addicted Member
    Join Date
    Aug 2016
    Posts
    191

    Re: [VB6] Smooth Scrollbar Control

    Quote Originally Posted by shagratt View Post
    Mmm... I tested it on two Windows 7 (32 and 64bits) and Windows 10 (64b) ... Cant see any bug. Only tested the flatbar/normal mode.
    Exactly what you did to found the bug? I will try to fix it but honestly now I'm in the 'all flat' style so if something is broken with the theming probably will comment all the code and strip that option.
    I don't remember exactly, seem pvIsLuna is not right.
    ucScrollbar1.Style = sThemed doesn't work (Win10 32bits and 64bits)
    Last edited by DaveDavis; Dec 6th, 2019 at 01:15 AM.

  7. #7
    Addicted Member
    Join Date
    Aug 2016
    Posts
    191

    Re: [VB6] Smooth Scrollbar Control

    Quote Originally Posted by shagratt View Post
    2) Not sure to understand this... but perhaps has something to do with me using the same max values for vertical than horizontal instead of using a bigger horizontal value.

    I'm doing right now another control (almost finished) that use the scrollbars and have a way better and complex example.
    I am on slow pc with win10,32 bits, I see the slow drawing. but on win10 newer PC, it is ok.

  8. #8
    New Member dseaman's Avatar
    Join Date
    Oct 2004
    Location
    Natal, Brazil
    Posts
    13

    Re: [VB6] Smooth Scrollbar Control

    How about MouseWheel support for Horizontal Scroillbar when Kybd Shift is down.

  9. #9
    Junior Member
    Join Date
    Sep 2016
    Posts
    31

    Re: [VB6] Smooth Scrollbar Control

    Hi shagratt
    I confirm the Themed style don't work.

  10. #10

    Thread Starter
    Member shagratt's Avatar
    Join Date
    Jul 2019
    Posts
    61

    Re: [VB6] Smooth Scrollbar Control

    Quote Originally Posted by DaveDavis View Post
    I don't remember exactly, seem pvIsLuna is not right.
    ucScrollbar1.Style = sThemed doesn't work (Win10 32bits and 64bits)
    Did you tried enabling themes with .manifest? Try to mix this control with another project that use themed standard controls (with manifest and the api calls to enable them)
    That was part of original Paul Caton Scrollbar and I never see it working (I dont use theme enabled controls)

  11. #11

    Thread Starter
    Member shagratt's Avatar
    Join Date
    Jul 2019
    Posts
    61

    Re: [VB6] Smooth Scrollbar Control

    Quote Originally Posted by dseaman View Post
    How about MouseWheel support for Horizontal Scroillbar when Kybd Shift is down.
    Thanks for the idea! That's a really cool feature! I will try to add it as soon as I can

  12. #12

    Thread Starter
    Member shagratt's Avatar
    Join Date
    Jul 2019
    Posts
    61

    Re: [VB6] Smooth Scrollbar Control

    Quote Originally Posted by dseaman View Post
    How about MouseWheel support for Horizontal Scroillbar when Kybd Shift is down.
    Done!
    I never realized that behaviour of web scrollbars! It's amazing that no matter how much one learns there is always something pretty simple you never heard of. I deserve the rubber duck award for this!

  13. #13
    Junior Member
    Join Date
    Sep 2016
    Posts
    31

    Re: [VB6] Smooth Scrollbar Control (updated 08/12/19)

    Hi shagratt

    Great but sThemed still does not work (.manifest ... InitCommonControls => inoperative)

    Regards

  14. #14

    Thread Starter
    Member shagratt's Avatar
    Join Date
    Jul 2019
    Posts
    61

    Re: [VB6] Smooth Scrollbar Control (updated 08/12/19)

    Quote Originally Posted by darjeeling View Post
    Hi shagratt
    Great but sThemed still does not work (.manifest ... InitCommonControls => inoperative)
    Regards
    I found the root of the problem, now Themed scrollbar works (Dont need to add manifest or initCommonControls)
    Updated the example to show how it look.

    Big thanks to DaveDavis and darjeeling for pointing it out and testing!

  15. #15
    Junior Member
    Join Date
    Sep 2016
    Posts
    31

    Re: [VB6] Smooth Scrollbar Control v1.0.9 (updated 08/12/19)

    Hi shagratt
    Congratulations !

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width