Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Scroll Bars in TextBox (VB6)

    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).

  2. #2
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scroll Bars in TextBox (VB6)

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

    pmatz

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scroll Bars in TextBox (VB6)

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

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Scroll Bars in TextBox (VB6)

    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

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scroll Bars in TextBox (VB6)

    Stuart,

    Can you reproduce this in native VB6?

    Mike

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Scroll Bars in TextBox (VB6)

    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.

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scroll Bars in TextBox (VB6)

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

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •