Results 1 to 7 of 7

Thread: VB5 Rich Text Box

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    3
    I am trying to get a horizontal scroll bar to appear in my VB5 Rich Text Box. I have ScrollBars set to rtfBoth (3), and Multiline set to True. DisableNoScroll (the worst property name I've ever heard of) is set to False. When the text is too wide, it wraps at the boundary of the control, and the scroll bar doesn't appear.

    The MSKB article Q175501 contains a possible explanation and workaround, but the sample code doesn't solve my problem--I still don't get a horizontal scroll bar when it says I should.

    I am using Richtx32.ocx v5.01.4319, 196880 bytes, 7/19/97 16:01:12. Is there a newer version for VB5?

    Thanks in advance,
    Ken

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    hmm.. this is for a normal textbox, but it may help you a bit in the right direction

    http://www.mvps.org/vbnet/code/textapi/txscroll.htm
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3
    Guest
    I have the one that comes with VB6, and it still doesn't scroll to the right when both scroll bars are enabled.... I have been wondering why it doesnt do that...... does anybody have any explanations?

  4. #4
    Fanatic Member
    Join Date
    Sep 2000
    Location
    UK.
    Posts
    728

    Unhappy Same here

    I had the same problem as Dennis. Bloody annoying. BTW, I know this isn't my thread, but does anyone know how to stop the scrolling of lines in the text box (not using LockWindowUpdate API) so that it doesn't flicker the scroll bars when i change focus programatically (i.e. change lines through code from line 1 to 5)?

    Bye
    Digital-X-Treme
    Contact me on MSN Messenger: [email protected]

    [VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
    / (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    3
    Thank you all for your responses.

    I would prefer not to have to resort to writing my own horizontal scroll bar code using the Win API, since the RichTextBox is supposed to provide it already.

    I'm stuck on the fact that the MSKB article on this subject (Q175501) contains sample code which demonstrates both the problem and a simple workaround. Unfortunately, as I said before, the workaround doesn't work for me.

    Say what you will about Microsoft (no, on second thought, don't!), but I don't believe they posted a workaround that was pure fiction. Instead, I think they must have been working with a different version of RichTx32.ocx, or perhaps there's some other file involved. Since my RichTx32.ocx is from 1997 and the article is from 1999, I wonder if there is a later version.

    But it sounds like VB6 has the same problem. Have any of you tried the Q175501 workaround? Here's the essential part:
    Private Sub Command2_Click()
    'These three lines of code provide a workaround
    Dim x As String
    x = RichTextBox2.TextRTF
    RichTextBox2.TextRTF = x
    End Sub

    Thanks again,
    Ken



  6. #6
    Hyperactive Member Asaf_99's Avatar
    Join Date
    Jul 2000
    Location
    Israel
    Posts
    335

    Thumbs down

    Sorry everyone, MultiLine has to go False...
    Maybe search for MSDN.
    Asaf Sagi

    ICQ: 61917199
    E-Mail: [email protected]

  7. #7

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    3
    What I am putting in the RichTextBox has line breaks in specific places (it's a report) using vbcrlf.

    When MultiLine is False, the line breaks are ignored.

    All I want is for the RichTextBox to behave like a "normal" Notepad window, with WordWrap off. It maintains the line breaks in the file, providing a horizontal scroll bar as needed.

Posting Permissions

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



Click Here to Expand Forum to Full Width