Reputation: 47
I dont know why but .net just showming me the error when i want to change richtextbox1.text color to red
Private Sub RichTextBox1_TextChanged(sender As Object, e As EventArgs) Handles RichTextBox1.TextChanged
Dim theColor As System.Drawing.Color
Dim loc As Int16
the colour to red.
If RichTextBox1.Text.Contains("CARD LOCKED") Then
loc = RichTextBox1.Find("CARD LOCKED")
RichTextBox1.Select(loc, 11)
RichTextBox1.SelectionColor = COLOR.red 'ERROR
RichTextBox1.ForeColor = COLOR.red 'ERRROR
End If
End Sub
Upvotes: 1
Views: 2204
Reputation: 36
Try to change COLOR.red with System.Drawing.Color.Red
Also, you should change the 'loc' type to Integer to avoid implicit conversions.
Upvotes: 2