Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 236
anaconda Avatar asked Apr 01 '26 06:04

anaconda


2 Answers

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

like image 151
Dutchs Avatar answered Apr 03 '26 20:04

Dutchs


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}");
like image 22
Ryan Naccarato Avatar answered Apr 03 '26 18:04

Ryan Naccarato



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!