[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.
* 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
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.
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.
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.
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.
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.
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.
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)
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!
Re: [VB6] Smooth Scrollbar Control v1.0.9b (updated 11/12/19)
Shagratt, great control, looks fantastic. Have installed ucScrollAdd and ucScrollBar from your ZIP (Smooth ScrollBar.v1.0.9b.zip). Standalone it runs perfectly. Installed FormExample1.FRM into one of my forms and get the following errors. Am using VB6 IDE in a WinXP VM running on a Win10 machine.
Screenshot of Log file created on install Attachment 180691
Screenshot of error on execution of code Attachment 180692
Re: [VB6] Smooth Scrollbar Control v1.0.9b (updated 11/12/19)
Originally Posted by SGordonS
Shagratt, great control, looks fantastic. Have installed ucScrollAdd and ucScrollBar from your ZIP (Smooth ScrollBar.v1.0.9b.zip). Standalone it runs perfectly. Installed FormExample1.FRM into one of my forms and get the following errors. Am using VB6 IDE in a WinXP VM running on a Win10 machine.
Screenshot of Log file created on install Attachment 180691
Screenshot of error on execution of code Attachment 180692
Can you advise?
Regards
Gordon
Cant see the attachments.
What's the problem ?
Try to use the Scrollbars that came with ucScrollAdd and not this ones (I got some problem fixed recently regarding the unloading). Also be sure to uncheck in the project properties "Remove information about unused ActiveX Controls"
Re: [VB6] Smooth Scrollbar Control v1.0.9b (updated 11/12/19)
Oops, screensaver shots saved as .png not .jpg. Tried to run v1.0.9b but reverted now to ScrollAdd CTRL v1.0
The 2 user control files load OK. When I load FormExample1, I get the following Log error:
Code:
Line 1210: Class ScrollAdd.ucScrollAdd of control ucScrollAdd1 was not a loaded control class.
Line 1213: The property name _ExtentX in ucScrollAdd1 is invalid.
Line 1214: The property name _ExtentY in ucScrollAdd1 is invalid.
When I execute the form, I get a "Method or data member not found" error, and "AddScroll is highlighted:
Code:
Option Explicit
' All examples uses just labels,picturebox and images controls to keep things simple.
Private Sub Form_Load()
'Add scrolling capabilities to the form
ucScrollAdd1.AddScroll Me
'Make it scroll with MouseWheel
ucScrollAdd1.TrackMouseWheel
End Sub
Re: [VB6] Smooth Scrollbar Control v1.0.9b (updated 11/12/19)
Originally Posted by SGordonS
Oops, screensaver shots saved as .png not .jpg. Tried to run v1.0.9b but reverted now to ScrollAdd CTRL v1.0
The 2 user control files load OK. When I load FormExample1, I get the following Log error:
Code:
Line 1210: Class ScrollAdd.ucScrollAdd of control ucScrollAdd1 was not a loaded control class.
Line 1213: The property name _ExtentX in ucScrollAdd1 is invalid.
Line 1214: The property name _ExtentY in ucScrollAdd1 is invalid.
When I execute the form, I get a "Method or data member not found" error, and "AddScroll is highlighted:
Code:
Option Explicit
' All examples uses just labels,picturebox and images controls to keep things simple.
Private Sub Form_Load()
'Add scrolling capabilities to the form
ucScrollAdd1.AddScroll Me
'Make it scroll with MouseWheel
ucScrollAdd1.TrackMouseWheel
End Sub
1) Have you tried to put a breakpoint on that line (ucScrollAdd1.AddScroll) and follow line by line to detect where is the problem?
2) Have you tried disabling the option in the project properties I told you ?
3) Check in the function "AddScroll" in the lines adding the scrollbars controls, and change the name of the project for your own project. (I put an example of that in the ScrollAdd thread)
Remember that this thread is about the scrollbars, not ScrollAdd , try to check that thread first cause I think you have the same problem as other user got and I'm sure the answers I give to him will help you too.
There seems to be still a problem with your attachments, still cant see them... Try to attach a sample project if you cant fix the problem and I will gladly check it.
Re: [VB6] Smooth Scrollbar Control v1.0.9b (updated 11/12/19)
Hi,
Thanks for this great scrollbar
I adapted it to scroll through a configuration/options panel of an app.
Just a minor question, I probably missed something but how can I set the amount of moving per wheel step (if possible) ?
I mean, actually, I scroll all the page with 4 wheel steps. I would reduce the moving distance so for example to have to turn the wheel for 10 steps to scroll all the page.
I changed LargeChange, SmallChange and WheelChange values but I do not see any difference.
Thanks
1 Hour vinyl mix live onEurodance90each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded
Re: [VB6] Smooth Scrollbar Control v1.0.9b (updated 11/12/19)
Hi,
I found that the theme doesn't work. The demo is the newest(v1.0.9b).
After checking, the problem exists in the pvCheckEnvironment sub.
[.dwMinorVersion > 0] excludes Windows Vista(6.0), Windows 10(10.0), and other systems support themes but with a minor version number of 0
So the code should be fixed as following:
Code:
If (.dwPlatformId = 2) Then ' NT based
If (.dwMajorVersion = 5) Then ' 2000 or XP
If (.dwMinorVersion > 0) Then ' XP or 2003
m_bIsXP = True
m_bIsLuna = pvIsLuna()
End If
ElseIf (.dwMajorVersion > 5) Then ' Vista or newer
m_bIsXP = True
m_bIsLuna = pvIsLuna()
End If
End If
Re: [VB6] Smooth Scrollbar Control v1.0.9b (updated 11/12/19)
Thanks for the fix linhongye! Sadly I'm out of time to spent on VB6 controls right now. If you want to make a fork and add your improvements and changes youre more than welcome.
Originally Posted by linhongye2010
Hi,
I found that the theme doesn't work. The demo is the newest(v1.0.9b).
After checking, the problem exists in the pvCheckEnvironment sub.
[.dwMinorVersion > 0] excludes Windows Vista(6.0), Windows 10(10.0), and other systems support themes but with a minor version number of 0
So the code should be fixed as following:
Code:
If (.dwPlatformId = 2) Then ' NT based
If (.dwMajorVersion = 5) Then ' 2000 or XP
If (.dwMinorVersion > 0) Then ' XP or 2003
m_bIsXP = True
m_bIsLuna = pvIsLuna()
End If
ElseIf (.dwMajorVersion > 5) Then ' Vista or newer
m_bIsXP = True
m_bIsLuna = pvIsLuna()
End If
End If