Win32 滚动条“倾斜距离”持续的?
在 Windows 上,当您使用鼠标单击并拖动滚动条以使其上下滚动时,您可以将鼠标移离滚动条约 120 像素,然后拖动停止工作。 (相比之下,在 Mac 上,您似乎可以将其移动到屏幕上的任何位置,并且拖动仍然会发生。)
是否有一个常量我可以获取,也许使用 SystemParametersInfo 或其他东西,来获取操作系统定义的值这?我正在使用一个模拟滚动条的控件,并且我想使用相同的行为来确定在滚动停止之前可以从滚动条拖动多远。
谢谢!
On 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GetSystemMetrics 有很多这样的值。但是,没有 Windows API 可以检索该值。
顺便说一句,在模拟控件之前您应该仔细考虑。有更多的代码来正确实现控件(包括对可访问性、键盘输入和其他行为的支持),这些代码往往会使您的滚动条要么缺乏功能,要么比您预期的成本更高。
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.