关于.Net中WinForms TrackBar控件的问题
有谁知道用鼠标移动手柄时调用 ValueChanged 事件之间框架轨迹栏使用的毫秒间隔?
我已经实现了自己的轨迹栏,我希望其行为与用户的期望一致。
我查看了反射器,但它是大多数实现不可见的控件之一。
ETA:其实仔细想想,事情并没有那么简单。对于小的更改,TrackBar 会针对每次更改引发事件。但是,如果您对握力进行大幅度快速变化,则不会提高每一步的事件。只是想知道框架到底是如何做到这一点的?
谢谢
Does anyone know the millisecond interval, used by the framework trackbar, between calling the ValueChanged event when moving the grip with a mouse?
I've implemented my own trackbar and I'd like the behaviour to be consistent with what the user expects.
I've had a look in reflector but it's one of those controls where most of the implementation is not viewable.
ETA: Actually, thinking about it, it's not as simple as that. For small changes, the TrackBar is raising the event for every change. However, if you make a large fast change with the grip, it will not raise the event for every step. Just wondering exactly how the framework does this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TrackBar 控件是本机 Windows Trackbar 控件的包装器。您将找不到任何相关代码。
这几乎肯定是由 WM_MOUSEMOVE 消息控制的,如果您快速移动鼠标,它会跳过报告一些中间位置。因此,您的自定义控件的行为应该与 TrackBar 完全相同。
The TrackBar control is a wrapper around the native Windows Trackbar control. You won't find any relevant code.
This is almost certainly controlled by WM_MOUSEMOVE messages, if you move the mouse fast, it skips reporting back some intermediate positions. Your custom control should therefore act exactly like TrackBar.