翻转滚动条 WPF
你好 我正在构建一个显示从 0 到最大值的标尺的控件。 0 值位于底部,最大值位于高于 0 的 y 值(最大值在我们滚动到它之前不可见)。 问题是,当0向下时,最大值向上。滚动条的0值向上,最大值向下。 我希望滚动条能够翻转。 我怎样才能做到这一点?
Hi
I am building a control that shows a ruler from 0 to a maximum. The 0 value is at the bottom and the maximum is in a higher y then the 0(The maximum is not visible until we scroll to it).
The problem is that while 0 is down and the maximum is up. The 0 value of the scroll bar is up and the maximum is down.
I want that the scroll bar will be flipped.
How can I do that ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
伙计们,想简单一点:
问候
Dudes, think simple:
Regards
如何使用值转换器来否定“最小值”、“最大值”和“值”属性。这样滚动条就会像你翻转它一样。
代码:
xaml:
How about using a value converter to negate your Minimum, Maximum and Value properties. That way the scrollbar will act as though you flipped it.
code:
xaml:
我受到这里一些答案的启发,并决定添加我的答案以供进一步参考。
对于滚动条来说,是否旋转 180 度或上下翻转并不重要,但对于其他控件(或某些样式)来说可能很重要。
这是我的代码:
I got inspired by some answers here and decided to add mine for further reference.
For the scrollbar it doesn't really matter whether it is rotated 180 degrees or flipped upside down but for other controls (or some style) it may be important.
Here's my code: