WPF 滑块问题 [英] WPF Slider problems

查看:23
本文介绍了WPF 滑块问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个旧的 win32 应用程序上看到了这种行为,当您在滑块轨道上的某个位置(而不是拇指上)按住鼠标时,拇指会移动到该位置.

I have seen this behaviour, on an old win32 app, where when you hold down the mouse at some position on the slider track (other than on the thumb), the thumb moves to that position.

在 WPF 中,似乎发生的是拇指移动了由 SmallChange 或 LargeChange 定义的距离.如果您继续持有,它会在延迟属性定义的一段时间后再次移动 SmallChange/LargeChange.

In WPF what seems to be happening is the thumb moves a distance defined either by SmallChange or LargeChange. If you keep holding, it moves by SmallChange/LargeChange again after some time as defined by the Delay property.

现在我想获得旧的行为?因此,如果拇指在 2 并且我在 10 附近按下鼠标,我希望它跳到 10.这样做的最佳方法是什么?

Now I want to get the old behaviour? So if the thumb is at 2 and I press the mouse down near 10 I want it to jump to 10. Whats the best way to do this?

提前感谢您的任何建议.

Thanks in advance for any suggestions.

推荐答案

Slider.IsMoveToPointEnabled

Slider.IsMoveToPointEnabled

我不知道在找到它之前我浏览了所有属性.

I dont know how many times I went through all the properties before finding it.

这篇关于WPF 滑块问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆