Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我发现在使用鼠标滚轮时滚动太多。我有一个非常短的ScrollViewer(一行高),其中包含 a 中的几行项目WrapPanel,并且它在一个“刻度”中向右滚动到底部,因此中间线永远不可见。
ScrollViewer
WrapPanel
不是很好的解决方案,但您可以添加一些带有文本的窗格 - 每行一个面板
ScrollViewer类使用IScrollInfo接口,有2个方法。
IScrollInfo
((IScrollInfo)myPanel).LineUp();// and LineDown()
添加一个方法到UIElement.MouseWheel事件和一个旋转 == 一个面板的孩子。
UIElement.MouseWheel
...或者你可以使用:
myScrollviewer.ScrollToVerticalOffset(offset);