如何设置 wpf 滑块控件拇指的高度
我想在数据网格单元格中放置一个滑块,并且该行的高度为 20,因此我想让滑块的拇指高度小于该高度。我设置了滑块本身的高度,但拇指似乎被切断了(即它没有缩小到我在 slider.height 属性中指定的高度)。我不想必须重写滑块控件的整个控件模板才能执行此操作。必须有某种方法来设置属性或类似的东西。
编辑:即使当我创建一个自定义滑块样式(其中包括具有我想要的尺寸的自定义拇指样式)时,它的尺寸仍然不正确。
有什么想法吗?
I want to put a slider in a datagrid cell and the row has a height of 20, so i'd like to make the height of the thumb of the slider smaller than that. I set the height of the slider itself, but the thumb appears to be cut off (i.e. it doesn't scale down to the height that I specify in the slider.height property). I don't want to have to override the entire control template of the slider control to do this. There's got to be some way of setting a property or something like that.
Edit: Even when I create a custom slider style which includes the custom thumb style with the sizes I want, it still doesn't size right.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不是很性感,但是当与 Slider.Height/Slider.Width 属性结合使用时,它就像一个魅力!
Not very sexy, but it works like a charm when combined whith the Slider.Height/Slider.Width properties !
设置拇指样式:
然后使用此样式滑块自定义控件
Set thumb style:
Then use this style slider custom control