Scrollbar Thumb Drag Behavior Windows vs. macOS

I have an app that uses a scrollbar to scroll through various kinds of information, typically being drawn onto a canvas in its .Paint event, based on the value of the scrollbar. When the user clicks one of the arrows at the end of the scrollbar, the scrollbar raises a .ValueChanged event, and in that event I invalidate the canvas, which then paints the appropriate information. That works great.

If the user holds down the mouse on of the arrows at the end of the scrollbar, the scrollbar moves until the thumb is released. the scrollbar raises ValueChanged events whenever its value changes, so the canvas redraws continuously as the thumb moves. This is perfect.

If the user drags the thumb and then drops it, the scrollbar raises a ValueChanged event and the canvas redraws appropriately. This is also great.

HOWEVER, then there’s this:

On the Mac, when the user drags the thumb, ValueChanged events are raised whenever the thumb moves far enough to change its value, so the canvas refreshes continuously while the thumb is moving.

On Windows, when the user drags the thumb, ValueChanged events are NOT raised until the user releases the mouse. This means the canvas can’t refresh while the thumb is moving.

This sure seems to me like a bug in Xojo, but it’s been this way for a long time. A Windows user recently complained, so now I’m paying attention. Does anyone know if this is the way Windows apps are supposed to work, or is it a bug? Any suggestions how to make it behave like it does on the Mac? I tried adding a timer, but it doesn’t seem to fire while the mouse is moving the thumb.

Thanks!

On windows is the livescroll property of the scrollbar set to true?

Wow, it WASN’T. I went back and looked at the code from a few months ago, before 2019R2, and that property was turned on. Somehow in moving to 2019R2, it got switched off - along with the scrollbars in several other windows (but not all of them).

I thought I was losing my mind, thank you for restoring my sanity with one simple question :slight_smile: