How can I make a WinForms ListView scroll vertical by MouseWheel?
I'm using C#.
How can I make a WinForms ListView scroll vertical by MouseWheel?
I'm using C#.
This is a duplicate of http://stackoverflow.com/questions/87134/c-listview-mouse-wheel-scroll-without-focus
Is it OK if the list scrolls only when it has focus? If so, use the Control.MouseWheel
event.
Do you want the list to scroll if it doesn't have focus? Then you need to need to either implement a mouse hook, as described in the other article, or take a look at the Application.AddMessageFilter
method. Application.AddMessageFilter
gives you a managed version of a mouse hook. You get to preview the messages as they come in. I wrote something about it here.