Capture mouse scroll-wheel

J

JezB

I have a windows application (c#) which does not display any scroll bar (I
really don't want it to!). However, I want to capture when the mouse
scroll-wheel is used to "page-through" some of my data, without recourse to
a scroll-bar. Can I capture when the mouse scroll-wheel is used? If so how ?
 
H

Herfried K. Wagner [MVP]

JezB said:
I have a windows application (c#) which does not display any scroll bar (I
really don't want it to!). However, I want to capture when the mouse
scroll-wheel is used to "page-through" some of my data, without recourse to
a scroll-bar. Can I capture when the mouse scroll-wheel is used? If so how
?

Override the control's 'OnMouseWheel' method.
 
L

Lloyd Dupont

Override the control's 'OnMouseWheel' method.
it should also be told that only the focused control will get mouse wheel
event
 
J

JezB

Well I ended up using the MouseWheel event rather than the OnMouseWheel
method: I found this by browsing the documentation, but strangely enough the
event did not appear in the intellisense list, which is why I missed it.

Thanks.
 
C

Chris Dunaway

JezB said:
event did not appear in the intellisense list, which is why I missed it.

Make sure you have "Hide Advanced members" in the setting turned off.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top