[Help Request] SyntaxHighlighting in vb.net

02/23/2013 23:15 DXStriker#1
Hello e.pvp,
Im trying to write an Editor for "LTSpice" Syntax, because i need it for my job. I Already have a method to find and color the keywords, which i saved in a list(Of String). But this method is way to slow and when i have a lot of words it flickers.

This is my method :

Code:
Public Sub HighlightSyntax()
Dim words As New List(Of String)
        words.Add("test ")
        If RichTextBox1.Text.Length > 0 Then
            Dim selectStart As Integer = RichTextBox1.SelectionStart
            RichTextBox1.Select(0, RichTextBox1.Text.Length)
            RichTextBox1.SelectionColor = Color.Black
            RichTextBox1.DeselectAll()
            For Each Wort As String In words
                Dim pos As Integer = 0
                Do While RichTextBox1.Text.ToUpper.IndexOf(Wort.ToUpper, pos) >= 0
                    pos = RichTextBox1.Text.ToUpper.IndexOf(Wort.ToUpper, pos)
                    RichTextBox1.Select(pos, Wort.Length)
                    RichTextBox1.SelectionColor = Color.Blue
                    pos += 1
                Loop
            Next
            RichTextBox1.SelectionStart = selectStart
            RichTextBox1.SelectionLength = 0
        End If
End Sub
Does anybody have a better method?

greez DXStriker
02/26/2013 17:20 DXStriker#2
#push up
02/27/2013 20:24 DXStriker#3
#Push
Need immernoch help
02/28/2013 00:52 Kraizy​#4
[Only registered and activated users can see links. Click Here To Register...]