Infragistics Ultragrid 中的鼠标中键单击功能

发布于 2024-12-05 10:46:53 字数 198 浏览 4 评论 0原文

在 Excel 中,单击鼠标中键可用作切换。也就是说,如果您按一次,它将允许您向您选择的方向滚动,直到您再次单击它。 然而,在 Infragistics Ultragrid 中,只有当鼠标中键保持按下状态时,此滚动功能才可用。如何使 Infragistics Ultragrid 鼠标中键单击像在 Excel 中一样工作?

另外,在winform中如何做到这一点?

In Excel, middle mouse button click work as a toggle. That is, if you press it once, it will allow you to scroll in your chosen direction till the time you click it again.
However, in Infragistics Ultragrid, this scrolling functionality is available only while middle mouse button remains pressed. How can I make Infragistics Ultragrid middle mouse button click work as in excel?

Otherwise also, what is the way to do it in winforms?

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

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

发布评论

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

评论(1

做个ˇ局外人 2024-12-12 10:46:53

它并不像您想象的那么复杂。单击鼠标滚轮或中键(取决于用户拥有的鼠标类型)会触发 MouseWheel 事件 必须像任何其他事件一样处理和处理。

您需要为您的应用程序配置一个小型“滚动状态机”。我的意思是,用户要么在 NormalMode 中滚动,其中使用滚动条或向上/向下滑动鼠标滚轮会产生相同的效果(向上/向下滚动)。或者,应用程序处于 HoverScrollingMode 模式,每当用户单击中键(或鼠标滚轮)并将鼠标向单击点向北或向南移动时,就会发生这种情况。

如果不了解您的应用程序当前如何处理其他类型的鼠标事件,我无法为您提供编程示例,但您的总体策略是处理这些 MouseWheel 事件,使用它们来切换您的应用程序状态(进入,例如,HoverScrollingMode),然后根据鼠标的当前位置以编程方式向上/向下移动视口。

希望这有帮助,祝你好运!

It's not as complicated as you might think. Clicking either the mouse wheel or middle button (depending on the type of Mouse the user has) fires off a MouseWheel event which must be handled and processed like any other event.

You'll need to configure a small "scrolling state machine" for you application. By this, I mean that the user is either scrolling in, say, a NormalMode, where using scroll bars or flicking up/down on the mouse wheel produces the same effect (scrolling up/down). Or, the application is in a HoverScrollingMode which occurs whenever the user has clicked the middle button (or mouse wheel) and is moving the mouse north or south of the click point.

I can't give you a programming example without seeing how your application currently handles other types of mouse events, but your overall strategy is to handle these MouseWheel events, use them to switch your application state (into, say, HoverScrollingMode) and then programmatically move the viewport up/down depending on the current position of their mouse.

Hope this helps, and good luck!

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