PDA

Click to See Complete Forum and Search --> : Rich text box


PaulB
Jan 17th, 2000, 08:12 PM
Hi

I know how to change the text colour in a rich text box, but how can I change the colour of individual lines of text when they are inserted?

e.g.

rtfOutput.Text = rtfOutput.Text & vbCrLf & "blah blah blah"

How could I make it red for instance without making the text already in the rich text box red also?

Thanks.

Joacim Andersson
Jan 17th, 2000, 09:22 PM
Use the SelText property to insert text and SelColor to select colour.

With RichTextBox1
.SelStart = Len(.Text)
.SelColor = vbRed
.SelText = vbCrLf & "here's a new line."
End With

Good luck!

------------------
Joacim Andersson
joacim@programmer.net
joacim@yellowblazer.com
www.YellowBlazer.com (http://www.YellowBlazer.com)

PaulB
Jan 18th, 2000, 04:52 PM
Thanks! :-)