there you go john

)
Public Function DisplayLine(ByVal richtextbox1 As RichTextBox, ByVal smessage As String)
Dim start As Integer
Dim length As Integer
smessage = "[" + DateTime.Now.ToString + "] " + smessage
RichTextBox1.Text = RichTextBox1.Text + smessage + Chr(13) + Chr(10)
If InStr(smessage.ToUpper, "WARNING") <> 0 Then
length = Len(smessage)
richtextbox1.SelectionStart = Len(richtextbox1.Text) - length
start = richtextbox1.SelectionStart
richtextbox1.Select(start, length)
richtextbox1.SelectionColor = Color.Orange
richtextbox1.SelectionProtected = True
End If
If InStr(smessage.ToUpper, "ERROR") <> 0 Then
length = Len(smessage)
richtextbox1.SelectionStart = Len(richtextbox1.Text) - length
start = richtextbox1.SelectionStart
'richtextbox1.Find(smessage, RichTextBoxFinds.MatchCase)
richtextbox1.Select(start, length)
richtextbox1.SelectionColor = Color.Red
richtextbox1.Select(start + length, 1)
End If
iline = iline + 1
richtextbox1.Refresh()
End Function
This changes the color for the line but when the next line is added to the box the color of all the lines default back.