我不知道为什么但.net只是在我想将richtextbox1.text颜色更改为红色时向我显示错误
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
答案 0 :(得分:2)
尝试使用System.Drawing.Color.Red
更改COLOR.red此外,您应该将'loc'类型更改为Integer以避免隐式转换。