There are a number of problems with VB6 scrollbars:
Problem #1:
I remember that in the past, when I had a scrollbar on a form, one of various ways of scrolling it was to right-click between the indicator and the top or bottom arrows of the scrollbar.
That right-click showed a popup menu with a number of menu items for the user such as "Scroll Here", "Scroll Up", "Scroll Down", etc.
The user could click on one of those menu items to scroll.
But now, I see that that popup menu does no longer pop up when I right-click between the indicator and the top or bottom arrows of the scrollbar.
This screen print shows exactly what I mean: https://i.imgur.com/KvJIkSm.jpeg
To clarify what that popup menu is, I can show you an example from the Windows Explorer's scrollbar: https://i.imgur.com/ABbOnQz.jpeg
I just checked a number of my VB6 projects where I had used scrollbars and that popup menu no longer pops up in any of them.
I remember it did show up in the past.
I don't know why it no longer shows up.
Does anybody know why?
Please advise.
Problem #2:
If you look at the first screen print above, you will notice that the indicator in the scrollbar (on the bottom of the screen) is fuzzy (instead of having a solid color).
Please compare it to the other scrollbar on the top of the screen (from an unrelated previous test).
The top one looks fine. But the bottom one has a fuzzy (dotted) appearance.
There are two key events for scrollbar controls: the Change event fires when you click on the scroll bar arrows or when you drag the indicator; the Scroll event fires while you drag the indicator
Therefore according to the above, SOMETIMES (in the case of dragging the indicator), both events are fired.
However, I can't recreate ANY scenario (dragging, clicking, scrolling by keyboard, scrolling programmically or any other way of scrolling) that would fire both of those events.
ANY way of scrolling (in my tests) fires only ONE of those two events. That is either the change event or the scroll event, but never both.
"Indicator" is pretty vague. But I assume you mean the thumb-box of the scrollbar. When a scrollbar has focus the thumb flashes several times and then goes "grayed" with a pattern if you are using the legacy Common Controls assembly. If the program uses Common Controls 6 instead the appearance is different.
As for those events, they work exactly as described in the documentation. Read that, not goofy "tutes" somebody cobbled together.
Therefore according to the above, SOMETIMES (in the case of dragging the indicator), both events are fired.
However, I can't recreate ANY scenario (dragging, clicking, scrolling by keyboard, scrolling programmically or any other way of scrolling) that would fire both of those events.
ANY way of scrolling (in my tests) fires only ONE of those two events. That is either the change event or the scroll event, but never both.
Am I missing anything?
Please help
Thanks.
As you hold the mouse button down and drag the scroll box up and down (or left and right for a horizontal scollbar), the "Scroll" event will be raised multiple times. Release the mouse button and then the "Change" event is raised once.
This is consistent with the concept of a "refinement drag", where you are dragging the scroll box around to reach the desired value, let it go, at which point the "Change" event is appropriately raised. After all, you aren't really committing the changed value of the scrollbar until you release the mouse button, so it wouldn't make sense if the "Change" event was raised repeatedly while dragging.