• Scroll Bars in TextBox (VB6)

    Author
    Topic
    #408776

    I feel silly asking this question because I know I’ve done it in the past a thousand times. I have a TextBox and I want the vertical scroll bar to appear when the text length exceeds the size of the box. I have multiline set to true and vertical set in scroll bars. The scroll bar always appears with no text in it. What am I doing wrong? I even tried writing code in the on change event to try and set that property, but it gave me a runtime error that it is a read-only property (contrary to what the help file says).

    Viewing 2 reply threads
    Author
    Replies
    • #866059

      Hi, does it work if you set the scroll bars to NONE, ?

      • #866095

        No, it will wordwrap and page down but not display the scroll bar

      • #866096

        No, it will wordwrap and page down but not display the scroll bar

    • #866255

      I just tried this in VBA in Word 2002 and it did what I would expect.

      I created a userform with a text box. Set Multiline to True and Scrollbars to fmScrollBarsBoth. The Vertical scroll bar only appeared when the text exceeded the height of the text box.

      StuartR

      • #866259

        Stuart,

        Can you reproduce this in native VB6?

        Mike

        • #866267

          Stuart’s description works for me on a VBA userform, but in VB6, I get the behavior you describe – the vertical scroll bar is always visible. I think this is the “standard” behavior.

          • #866271

            Alright, I’ll just chock it up to another inconsistency between Microsoft’s developing products.

            Thanks for identifying this for me Hans (and all).

          • #866272

            Alright, I’ll just chock it up to another inconsistency between Microsoft’s developing products.

            Thanks for identifying this for me Hans (and all).

        • #866268

          Stuart’s description works for me on a VBA userform, but in VB6, I get the behavior you describe – the vertical scroll bar is always visible. I think this is the “standard” behavior.

      • #866260

        Stuart,

        Can you reproduce this in native VB6?

        Mike

    • #866256

      I just tried this in VBA in Word 2002 and it did what I would expect.

      I created a userform with a text box. Set Multiline to True and Scrollbars to fmScrollBarsBoth. The Vertical scroll bar only appeared when the text exceeded the height of the text box.

      StuartR

    Viewing 2 reply threads
    Reply To: Scroll Bars in TextBox (VB6)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: