开发者

Win32 scrollbar "slop distance" constant?

On 开发者_StackOverflow社区Windows, when you use the mouse to click and drag in a scrollbar to scroll it up and down, you can move the mouse approximately ~120 pixels away from the scrollbar before the dragging stops working. (By contrast, on the mac you appear to be able to move it anywhere on the screen and the drag will still happen.)

Is there a constant I can get at, maybe using SystemParametersInfo or something, to get the OS-defined value for this? I'm using a control that simulates a scrollbar, and I'd like to use the same behavior for how far you can drag away from the bar before scrolling stops.

Thanks!


GetSystemMetrics has a lot of these values. However, there is no Windows API that retrieves this value.

As an aside, you should think carefully before simulating a control. There is a lot more code to implementing the control correctly (including support for accessibility, keyboarding and other behaviours) that will tend to make your scroll bar either lacking in features or more costly than you intend.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜