Monday, February 7, 2011

C# ListView mouse wheel scroll without focus

I'm making a WinForms app with a ListView set to detail so that several columns can be displayed.

I'd like for this list to scroll when the mouse is over the control and the user uses the mouse scroll wheel. Right now, scrolling only happens when the ListView has focus.

How can I make the ListView scroll even when it doesn't have focus?

  • You'll normally only get mouse/keyboard events to a window or control when it has focus. If you want to see them without focus then you're going to have to put in place a lower-level hook.

    Here is an example low level mouse hook

    From Ray Hayes

0 comments:

Post a Comment