How do you make the VScroll1 control respond to mousewheel scrolling?

Posted on 2004-11-23
Last Modified: 2012-08-14
I can't seem to make the VScroll1 control respond to mousewheel movement.  Any suggestions?  Thnx.
Question by:larrysy
    LVL 17

    Expert Comment

    You need the following small Tool "VBScroll" (Version 1.3.1 - 26 KB)

    Author Comment

    Try the following code - 3 controls - Picture 1, Picture2, and VScroll1, Picture2 is inside Picture 1. If you run it, the scrollbar wont respond to a mousewheel scroll.  I need some code which can be included in the compiled .exe.

    Private Sub Form_Load()
    Picture1.Move 0, 0
    Picture2.Move 0, 0
    Picture2.Height = Picture1.Height * 2
    Picture2.Width = Picture1.Width
    Me.Width = Picture1.Width + VScroll1.Width + 150
    Me.Height = Picture1.Height + 1000
    With VScroll1
       .Top = 0
       .Left = Picture1.Width
       .Height = Picture1.Height
    End With
    VScroll1.Max = Picture2.Height - Picture1.Height
    VScroll1.LargeChange = VScroll1.Max / 10
    VScroll1.SmallChange = 100
    End Sub

    Private Sub VScroll1_Change()
    Picture2.Top = -VScroll1.Value
    End Sub

    Private Sub VScroll1_Scroll()
    End Sub
    LVL 32

    Accepted Solution

    Here are a couple samples of how to deal with the WM_MOUSEWHEEL message in VB6:

    Adding Scroll Bars to Forms, PictureBoxes and User Controls

    How to implement additional support for wheel mice in VB6
    LVL 17

    Assisted Solution

    I checked your sample, larrysy - Only when  running the "intellipoint" software, then it scrolls !

    You need the "intellipoint" mouse software (Microsoft). The following picture shows several mouse types:

    <img src="">

    Download Microsoft's "intellipoint" mouse software:



    Author Comment

    Thanks vb_elmar and Erick37, I finally settled on the example.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now