Hello, My name is TheMeq and this is my first post. So Hi.
I'll jump straight in.
I am making a code editor to go along side a program I am developing, it uses XML.
What I am looking to do is add syntax highlighting, which I have working for individual strings, but I may have some strings that have some changeable data.
This works fine and dandy, but If I try to do something like
Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
Dim wordsRED As New List(Of String)
If RichTextBox1.Text.Length > 0 Then
Dim selectStart As Integer = RichTextBox1.SelectionStart
RichTextBox1.SelectionColor = Color.Black
'Red Colored Words
For Each oneWord As String In wordsRED
Dim pos As Integer = 0
Do While RichTextBox1.Text.ToUpper.IndexOf(oneWord.ToUpper, pos) >= 0
pos = RichTextBox1.Text.ToUpper.IndexOf(oneWord.ToUpper, pos)
RichTextBox1.SelectionColor = Color.Red
pos += 1
RichTextBox1.SelectionStart = selectStart
RichTextBox1.SelectionLength = 0
It doesn't recognise the * wildcard. So I am guessing that you can't do it this way, is there any other way to do it?