ho riscritto questo codice e funziona ma il maching precedente viene resettato come colore:
codice:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim start As Integer
first = RichTextBox1.Find("[0]", start, RichTextBoxFinds.MatchCase)
last = RichTextBox1.Find("[/0]", start, RichTextBoxFinds.MatchCase)
If last <> -1 Then
If first <> -1 Then
RichTextBox1.Text = Replace(RichTextBox1.Text, "[0]", "")
RichTextBox1.Text = Replace(RichTextBox1.Text, "[/0]", "")
RichTextBox1.Select(first, last - first)
RichTextBox1.SelectionColor = Color.Blue
End If
End If
start = Len(RichTextBox1.Text)
End Sub