PDA

Click to See Complete Forum and Search --> : Does anyone know this?


ande211
Jan 24th, 2000, 05:15 AM
How do I change part of a RTB control's text color? For instance
<Andy> hello
<Andy> how are you?
I just want to change <Andy> to a different color on each new line?

Help please...

ande211

LG
Jan 24th, 2000, 12:18 PM
Hi, there.
Put this code on CommandButton click event:

If lFound < 0 Then 'Find First
lFound = RichTextBox1.Find("Andy", 0)
RichTextBox1.SelColor = vbRed
Else
'Find Next
lFound = RichTextBox1.Find("Andy", lFound + 1)
RichTextBox1.SelColor = vbRed
End If

Larisa

[This message has been edited by LG (edited 01-25-2000).]