|
-
Sep 8th, 2000, 03:08 PM
#1
Thread Starter
New Member
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
-
Sep 8th, 2000, 03:13 PM
#2
Frenzied Member
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.
-
Sep 8th, 2000, 03:23 PM
#3
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?
-
Sep 8th, 2000, 04:34 PM
#4
Fanatic Member
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]
-
Sep 9th, 2000, 01:30 PM
#5
Thread Starter
New Member
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
-
Sep 9th, 2000, 01:52 PM
#6
-
Sep 9th, 2000, 02:31 PM
#7
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|