3

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?

Rotem
  • 21,452
  • 6
  • 62
  • 109
anaconda
  • 1,065
  • 10
  • 20

3 Answers3

5

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

Community
  • 1
  • 1
Raphael Smit
  • 652
  • 6
  • 11
5

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}");
Ryan Naccarato
  • 674
  • 8
  • 12
-2

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.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • 5
    Believe me, I already know all those stuffs you write about but it doesn't matter for me for my purpose. – anaconda Apr 20 '10 at 12:50