Hey all,
I'm building a custom scrollbar, and so far it's going great.
There is a bit of behavior in the standard Windows (7 anyway) scrollbar that i want to preserve, which frankly I never noticed until I started writing this control and really examining what a scrollbar does.
When you are dragging the thumb, if you move your mouse too far outside of the bounds of the scrollbar, the thumb will "snap back" to it's original position. If you then move the mouse back in range before releasing the mosue button, the thumb will "return" to the current mouse offset. Every standard scrollbar I've seen on Windows 7 does this. I'm assuming other version of Windows do it as well. On my system, it looks like the "out of range" offset is around 125px.
My questions are:
- Most importantly, does anybody know if there is a some form of system constant defining this offset value, so that when I implement it, if the offset changes from one OS to another my control behaves appropriately? Or is it hard-coded into the native scrollbar implementation (and therefore will be hardcoded into mine)? I looked in SystemInformation and found nothing. But if there is something I can P/Invoke, I'll do it, so that it behaves consistently on various OS.
- Secondarily, does anybody have any theory as to what the usability reason why this was implemented? The mouse is being captured at this point and the control could measure the thumb delta even when the mouse if outisde of the active window. It just seems kind of odd...the user is still holding down the mouse. Clearly they mean to still drag the thumb, otherwise they would have let go. I'm thinking that maybe the reason this exists is to serve as an abort mechanism: if the user decides they don't want to scroll after all, they can just move the mouse away and let-go of the button, and will return to original position. That's a stretch...but it's all I can think of. ;-)
Thanks in advance for your thoughts...
- Ryan