0
Private Sub Write_code_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Write_code.TextChanged
Dim strWord As String
Dim lPos As Long
strWord = "read"
lPos = InStr(1, Write_code.Text, strWord, vbTextCompare)
If lPos > 0 Then
With Write_code
.SelectionStart = lPos - 1
.SelectionLength = Len(strWord)
.SelectionColor = Color.Green
.SelectionStart = Len(Write_code.Text)
.SelectionLength = 0
.SelectionColor = Color.Blue
End With
End If
End Sub
这是我的代码,我有一个问题,当我再次打开该文本,它不能添加文字(可以只添加到末尾文本末尾的文字)。有没有其他的代码可以帮助我。使用颜色RichTextBox的,但是在CON TRO鼠标错误时附加字符的字符
您的标题不能反映您的问题的详细信息。请更新以避免可能被关闭的问题。 – Codexer
对不起。我已经修复了它 –