Dear all expert programmer,
Please tell me how to make text color in Richtextbox.
If Ricctextbox have data below
012-456-896
I want to make 456 to red color but I don't know how to make it.
Printable View
Dear all expert programmer,
Please tell me how to make text color in Richtextbox.
If Ricctextbox have data below
012-456-896
I want to make 456 to red color but I don't know how to make it.
This what you are looking for ?
vb Code:
Private Sub Command1_Click() Dim lPos As Long lPos = RichTextBox1.Find("896") 'Find the text If lPos > -1 Then 'If found RichTextBox1.SelStart = lPos 'Start selection RichTextBox1.SelLength = 3 'select 3 chraters RichTextBox1.SelColor = vbRed 'Color End If End Sub