carrige returns in RTF

n2amg
10-07-2001, 11:35 AM
I have a rich text box that gets data from a modem. When the data in the string is a carrige return I see a vertical line in place of the CR it looks like this | what is causing this and how can I correct it??

Rick

Volte
10-07-2001, 11:37 AM
make sure that the MultiLine property is set to true.

Squirm
10-07-2001, 11:37 AM
Is the data added in RTF or plain text?

If it is RTF you need to Replace every vbCrLf with "\par "

hope that helps.......

Volte
10-07-2001, 11:39 AM
aer you using the SelText or SelRTF property (or just .Text = .Text & "<text>")?

n2amg
10-07-2001, 11:40 AM
Thats a good question.. I'm assuming that since the text box is a richtext box that it would be using the RTF format..

Squirm
10-07-2001, 11:42 AM
Well if you're saying:

<pre>RichTextBox1.Text = "hello"</pre>

then you're dealing with plain text, just make sure Multiline is True. If you're using:

<pre>RichTextBox1.TextRTF = "hello"</pre>

then you're dealing with RTF, in which case you need to replace. I think you must be using the Text property.

Thinker
10-07-2001, 08:46 PM
When dealing with the Text property in the RTB, new lines must be
separated with a carriage return/line feed sequence. If you will just
replace each carriage return (vbCr) with a carriage return/line feed
sequence (vbCrLf), you will get new lines instead of the |.

I think therefore I am... sometimes right. images/icons/wink.gif

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum