如何让滑块在刻度条上一键移动到值 [英] How do I make Slider move to value in one click on tick bar

查看:18
本文介绍了如何让滑块在刻度条上一键移动到值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个滑块,下面是代码:

I am working on a slider, and below is the code:

<Slider Name="testother" Margin="10,0,0,0" Width="200" IsSnapToTickEnabled="True"
            Value="0.5" Minimum="0" Maximum="1" 
            TickPlacement="BottomRight"  TickFrequency="0.25" LargeChange="0.25"></Slider>

当滑块在最左边时,我们想将滑块移到最右边,需要单击 3 次才能使滑块在刻度的每个停止处导航.指针应一键快速移动.有没有办法解决这个问题?

when the slider is on extreme left,and we want to bring the slider to extreme right, it takes 3 clicks having slider navigate at every stop of the tick. the pointer should move quickly at one click. Is there any way to solve this ?

推荐答案

您需要将 IsMoveToPointEnabled 设置为 True 才能完成此操作!

You need IsMoveToPointEnabled to be set to True to get this thing done!

<Slider IsSnapToTickEnabled="True"
        Value="0.5"
        Minimum="0"
        Maximum="1" 
        TickPlacement="BottomRight"
        TickFrequency="0.25"
        IsMoveToPointEnabled="True"
        LargeChange="1"/>

如果您想从键盘更改滑块值,您仍然可以设置小的更改

You can still set small change in case you want to change slider values from keyboard

这篇关于如何让滑块在刻度条上一键移动到值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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