是否可以在 WPF ScrollViewer 上调整鼠标滚轮滚动距离?

发布于 2024-09-11 20:57:46 字数 128 浏览 1 评论 0原文

我发现使用鼠标滚轮时滚动太多。我有一个非常短的 ScrollViewer (一行高),其中包含 WrapPanel 中的几行项目,并且它在一个“刻度”内向右滚动到底部,因此中间线永远不可见。

I find it is scrolling too much at a time when the mouse scroll wheel is used. I have a very short ScrollViewer (one line tall) that contains a few lines of items in a WrapPanel, and it is scrolling right to the bottom in one "tick" so that the middle line is never visible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

匿名的好友 2024-09-18 20:57:46

这不是一个很好的解决方案,但您可以添加一些带有文本的窗格 - 每行一个面板

ScrollViewer 类使用 IScrollInfo 接口,并且有 2 种方法。

((IScrollInfo)myPanel).LineUp();// and LineDown()

UIElement.MouseWheel 事件添加一种方法,并且一次旋转 == 面板的一个子项。

...或者你可以使用:

 myScrollviewer.ScrollToVerticalOffset(offset);

Not nice solution but you could add a few panes with text - one panel each line

ScrollViewer class uses IScrollInfo interface and there are 2 methods.

((IScrollInfo)myPanel).LineUp();// and LineDown()

Add a method to UIElement.MouseWheel event and one rotation == one children of a panel.

...or you could use:

 myScrollviewer.ScrollToVerticalOffset(offset);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文