SmallChange是ScrollBar的一个属性,但它不能改变scrollBar
我期望ScrollBar的值改变1,所以我设置SmallChange为1,但是改变ScrollBar的值是无效的。
<ScrollBar Minimum="0" Maximum="20" Value="0" SmallChange="1" ValueChanged="ScrollBar_ValueChanged"></ScrollBar>
private void ScrollBar_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
double t = (sender as ScrollBar).Value;
}
拖拽重击,但t不是0,1.0,2.0,3.0……,
I expect ScrollBar value changed by 1, so I set SmallChange is 1,But it is invalid to change value of ScrollBar.
<ScrollBar Minimum="0" Maximum="20" Value="0" SmallChange="1" ValueChanged="ScrollBar_ValueChanged"></ScrollBar>
private void ScrollBar_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
double t = (sender as ScrollBar).Value;
}
Drag thump,But t is not 0,1.0,2.0,3.0......,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SmallChange 是当您单击其中一个箭头时 Value 的变化量。当您拖动拇指时,更改取决于最大、最小、拇指可以移动的像素数以及您实际拖动拇指的像素数。例如,如果拇指可以移动 100 个像素,并且您将其拖动 1 个像素,则值将按(最大值 - 最小值)/100 变化。
SmallChange is how much Value changes when you click on one of the arrows. When you drag the thumb, the change depends on Maximum, Minimum, the number of pixels the thumb can move and the number of pixels you actually dragged the thumb. For example if the thumb can move 100 pixels and you drag it for one pixel, then Value changes by (Maximum - Minimum)/100.