Woods
Woods

Reputation: 47

Visual Basic error BC30456 'RED is not a member of 'COLOR'

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

Answers (1)

ArveK
ArveK

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

Related Questions