开发者

ContextMenuStrip and mouse wheel

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?


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...

var menu = new ContextMenuStrip();
menu.MouseWheel += (ob, ev) => SendKeys.SendWait(ev.Delta > 0 ? "{UP}" : "{DOWN}");


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜