WheelScroll for TextBox RRS feed

  • Question

  •  I used Peter Thornton ScrollWheel API and it works with my combo boxes and form. The problem i am facing right now is that i have a textbox for comments and it is usually very long so and i activated the verticalscroll property which allows users to click on scroll bar to scroll .

    I will like them to be able to use their mouse wheel scroll too; so I wrote a code for the textbox like the rest (combobox and form) on the userform but the mousescroll wheel doesn't work on that textbox.

    See code below:

    Private Sub TextBox11_MouseMove( _
                            ByVal Button As Integer, ByVal Shift As Integer, _
                            ByVal X As Single, ByVal Y As Single)
                    HookListBoxScroll Me, Me.TextBox11
    End Sub


    Please any suggestions? 

    Thursday, August 11, 2016 4:26 PM

All replies

  • Hello teecute,

    The wheel scroll approach won't work with a textbox, at least not directly. Size the textbox to show all the text with no scrollbars, put it in a frame with scrollbars, and set the frame to scroll.

    Sunday, August 14, 2016 11:15 AM