I've developed a sort-of, half-decent text parser which changes text color in a RichTextBox (named scriptt). Currentterm is a global variable set to what the user types.
Now, I have a Timer which interval is set to 1, and enabled from start, and is always enabled.
In the Timer1.Tick event, this occurs:
Select Case currentterm
..........Case "\n", "\""", "=", "==", "$", "#", "at", "bg"
...............scriptt.SelectionStart -= 2
...............scriptt.SelectionLength = 2
...............scriptt.SelectionColor = Color.Blue
...............scriptt.SelectionLength = 0
...............scriptt.SelectionStart += 2
...............scriptt.SelectionColor = Color.Black
...............currentterm = ""
..........End Select
End Select
Now for some reason, when I type any of the above valid cases, it will work the first time. However, doing it again does NOT seem to work at all! Please help!
Now, I have a Timer which interval is set to 1, and enabled from start, and is always enabled.
In the Timer1.Tick event, this occurs:
Select Case currentterm
..........Case "\n", "\""", "=", "==", "$", "#", "at", "bg"
...............scriptt.SelectionStart -= 2
...............scriptt.SelectionLength = 2
...............scriptt.SelectionColor = Color.Blue
...............scriptt.SelectionLength = 0
...............scriptt.SelectionStart += 2
...............scriptt.SelectionColor = Color.Black
...............currentterm = ""
..........End Select
End Select
Now for some reason, when I type any of the above valid cases, it will work the first time. However, doing it again does NOT seem to work at all! Please help!