Carriage Return in RichTextBox Control

how to do a carriage return in run time programmatically in richtextbox control?
[80 byte] By [peevee12] at [2007-11-18 2:13:32]
# 1 Re: Carriage Return in RichTextBox Control
You can either:
1) use vbNewLine constant:

RichTextBox1.Text=RichText1.Text & vbNewLine

2) use "\par "

in rtf format the new paragraph is marked by "\par " command
but if you want to use it you must assign it to RichTextBox1.TextRTF.

Actually if you just put it at the end of TextRTF you will got nothing. That is because the end of rtf is like that:
........
\par Some text at line1
\par Some text at line2
\par }

The bracket at the end means end of rtf and all stuff after it is meaningless. So To insert "\par " you must do this before the ending bracket.

I hope this will help you solve your problem. Also there are many rtf commands like:

\b Test \b0 - makes Test bold
\i Test \i0 - Italic
\tab - Tab
\protect Test \protect0 - protected text. You can't modify it

and so on.
nikidd at 2007-11-10 0:02:32 >