How do I make a vertical scrollbar react to a wheelmouse (i.e. when the user "spins" the wheel the vertical scrollbar moves up and down with the mouse)?
Printable View
How do I make a vertical scrollbar react to a wheelmouse (i.e. when the user "spins" the wheel the vertical scrollbar moves up and down with the mouse)?
You'll have to subclass the form or control which you need the mousewheel to work over, then intercept the message WM_MOUSEWHEEL.
How would I do that? And do I actually need to have the vertical scroll bar to get the messages? (I'm working on a map editor and a friend suggested putting an invisible scroll bar so that the map could be moved quite easily. However, if I don't need the vertical scroll bar at all, that would be even better!)
What if the user doesn't have a mouse wheel? Then how would that user scroll?
Then they just push the mouse cursor to the edge of the screen to scroll around!
I still need help! Come on people!
well you could just subclass the form, and as long as your form has focus it should recieve the WM_MOUSEWHEEL message. you won't need the verticle scrollbar.
:mad: I realize that I have to "subclass the form"! I don't know how to!!! Can somebody simply explain how to do that!
Can't anyone help me? Pleaz!!!
ok. this is VERY IMPORTANT. YOU MUST NOT END THE PROGRAM USING END, STOP, or PRESS THE END AND PAUSE BUTTON IN THE IDE! it would close the entire program and also VB if you are running in debug mode. you MUST unsubclass your program when you close. with that said, here's is an example
actually this is stupid.... :rolleyes:
i don't know if it is only XP, but the scrollbar has scroll on by itself. it doesn't need subclassing.
Windows 2000 doesn't have scroll capabilities "built-in". I use grids all the time, and the mouse wheel does not work for them...
FYI.
Thanks...
I'm not sure about the scroll property though... On my version of XP there is no property like that!