Results 1 to 13 of 13

Thread: Vertical Scrollbar and WheelMouse

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280

    Vertical Scrollbar and WheelMouse

    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)?

  2. #2
    Fanatic Member
    Join Date
    Jun 2001
    Posts
    521
    You'll have to subclass the form or control which you need the mousewheel to work over, then intercept the message WM_MOUSEWHEEL.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280
    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!)

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    What if the user doesn't have a mouse wheel? Then how would that user scroll?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280

    Wink

    Then they just push the mouse cursor to the edge of the screen to scroll around!

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280
    I still need help! Come on people!

  7. #7
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280
    I realize that I have to "subclass the form"! I don't know how to!!! Can somebody simply explain how to do that!

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280
    Can't anyone help me? Pleaz!!!

  10. #10
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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
    Attached Files Attached Files
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  11. #11
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    actually this is stupid....


    i don't know if it is only XP, but the scrollbar has scroll on by itself. it doesn't need subclassing.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  12. #12
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    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.
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280
    Thanks...

    I'm not sure about the scroll property though... On my version of XP there is no property like that!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width