WPF 滑块问题

WPF Slider problems(WPF 滑块问题)
本文介绍了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 滑块问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)