Scrollable Form in VB6 with the wheel of the mouse

In vb6 I am trying to make a form that is rather large.   I located code that allows the form to be scrollable.  The onlyl problem is that I would like to scroll the form with the wheel on my mouse, but that is not happening.  Is this something that I need to program in somehow?  Here is the code below:

  Dim oldPos As Integer


   Private Sub Form_Load()
   Dim iFullFormHeigth As Integer
   Dim iDisplayHeight As Integer
   
   iFullFormHeigth = 3765
   iDisplayHeight = 1800

   Me.Height = iDisplayHeight
  
   With VScroll1
      .Height = Me.ScaleHeight
      .Min = 0
      .Max = iFullFormHeigth - iDisplayHeight
      .SmallChange = Screen.TwipsPerPixelY * 10
      .LargeChange = .SmallChange
   End With
   End Sub


   Private Sub pScrollForm()
      Dim ctl As Control
  
      For Each ctl In Me.Controls
         If Not (TypeOf ctl Is VScrollBar) And _
            Not (TypeOf ctl Is CommandButton) Then
             ctl.Top = ctl.Top + oldPos - VScroll1.Value
         End If
      Next
  
      oldPos = VScroll1.Value
   End Sub


   Private Sub VScroll1_Change()
      Call pScrollForm
   End Sub


   Private Sub VScroll1_Scroll()
      Call pScrollForm
   End Sub

Open in new window

al4629740Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Roy CoxGroup Finance ManagerCommented:
This might help

Scroll Wheel Fix for VB6
al4629740Author Commented:
So am I editing a file in Windows? or the actual vb6 program?
Roy CoxGroup Finance ManagerCommented:
I haven't used this, I just remembered seeing it before.

Here's a discussion with some suggestions.

Here's a similar solution posted on EE

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Roy CoxGroup Finance ManagerCommented:
Pleased to help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.