如何用代码写出让richTextBox中第10到第20个字符变成红色
--------------------编程问答-------------------- Public Class Form1Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
If RichTextBox1.TextLength = 10 Or RichTextBox1.TextLength = 20 Then
RichTextBox1.Select(9, 1)
RichTextBox1.SelectionColor = Color.Red
RichTextBox1.Select(RichTextBox1.TextLength, 0)
End If
If RichTextBox1.TextLength = 20 Then
RichTextBox1.Select(RichTextBox1.TextLength, 0)
RichTextBox1.SelectionColor = Color.Black
End If
End Sub
End Class --------------------编程问答-------------------- 参考关键字变色的效果
http://social.msdn.microsoft.com/Forums/zh-CN/233/thread/552eae44-76d2-4cf6-8eab-c49ce1136d57
补充:.NET技术 , VB.NET