曾经有一项目,好似有点类似吧,
Private Sub RichTextBox1_Change(Index As Integer)
Dim Mun字数 As Integer
Mun字数 = Len(Trim$(Text2.Text))
If Mun字数 >= 1 Then
If Index = 3 And RichTextBox1(3) <> "" Then
RichTextBox1(3).SelStart = 0
RichTextBox1(3).SelLength = (Len(Trim$(RichTextBox1(3).Text)))
RichTextBox1(3).SelColor = vbBlack
For i = 1 To (Len(Trim$(RichTextBox1(3).Text)) - Mun字数)
If Text2 = Mid(Trim$(RichTextBox1(3).Text), i, Mun字数) Then
RichTextBox1(3).SelStart = i - 1
RichTextBox1(3).SelLength = Mun字数
RichTextBox1(3).SelColor = vbRed
End If
Next i
End If
End If