Try this
vb Code:
Private Sub AddText(ByVal Text As String, ByVal Color As Drawing.Color) Dim strWords() As String = Text.Split(" "c) Dim colors(3) As Drawing.Color colors(0) = Drawing.Color.Red colors(1) = Drawing.Color.Blue colors(2) = Drawing.Color.Green colors(3) = Drawing.Color.Brown ' add more colors if you need With txtChat For j As Integer = 0 To strWords.Length - 1 .SelectionColor = colors(j Mod colors.Length) .AppendText(strWords(j) & " ") Next End With End Sub





Reply With Quote