Share via

Mouse Scrollwheel in textbox

Anonymous
2013-01-29T16:45:42+00:00

In a textbox, which is a memo data type, so lots of text, I can't seem to get the mouse's scroolwheel to move up and down the content of the active control (ie, the textbox).  I'm assuming I'm overlooking some basic property, but can't seem to figure it out.  How can I get this functional?

QuestionBoy

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2013-01-30T08:24:28+00:00

You'd have to write code in the On Mouse Wheel event of the form. The code below uses SendKeys, which is reputed to be flaky (but it generally works OK for me):

Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)

    Dim i As Long

    Dim s As String

    If Me.ActiveControl.Name = "Notes" Then ' replace with name of text box

        If Count > 0 Then

            For i = 1 To Count

                s = s & "{DOWN}"

            Next i

        Else

            For i = 1 To -Count

                s = s & "{UP}"

            Next i

        End If

        SendKeys s

    End If

End Sub

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful