ContextMenuStrip 和鼠标滚轮
我有一个包含许多项目的 ContextMenuStrip。
如何处理鼠标滚轮滚动项目?
我在网上搜索但没有找到有用的东西。
或者如何从上下文菜单中获取第一个/最后一个显示/可见项目?
I have a ContextMenuStrip with many items.
How to handle mouse wheel to scroll throught items?
I search the net but nothing find usefull.
Or how to get first/last displayed/visible item from contextmenu?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
由于这是一个老问题,您可能不需要这个,但以防万一并供将来参考。
您可以模拟上下按键来滚动浏览它,它远非完美,但它比必须编写自己的ContextMenuStrip来处理滚轮。
鼠标滚轮滚动工具条菜单项
Since this is a old question you probably wont need this, but just in-case and for future reference.
You can simulate key up and down presses to scroll through it, its far from perfect but it beats having to write your own ContextMenuStrip to handle the scroll wheel.
Mouse wheel scrolling Toolstrip menu items
虽然这个问题很老了,但有人仍然可能从我的输入中受益......
Although this question is very old, someone may still benefit from my input...
向 CMS 添加如此多的项目以至于需要滚动,这完全违背了上下文菜单的目的。不要设计难以使用且需要用户浏览数十个项目的 UI。您的用户会不喜欢您充满热情的编程,并会找出您住在哪里。
CMS 支持子菜单。对菜单项进行分类。
Adding so many items to a CMS that it requires to be scrolled completely defeats the purpose of a context menu. Don't design a UI that's hard to use and requires the user to scan through dozens of items. Your users will dislike you program with a passion and will find out where you live.
A CMS supports sub-menus. Categorize your menu items.