Help with RTB Highlighting

Apr 1 2009 2:48 PM
Hi!

I made a highlight script that checks the text and highlights matched words:
    foreach (Match keyWordMatch in keyWords.Matches(txtIzvor.Text))
                        {

                            txtIzvor.Select(keyWordMatch.Index, keyWordMatch.Length);
                            txtIzvor.SelectionColor = System.Drawing.Color.Blue;
                            txtIzvor.SelectionStart = selPos;

                            txtIzvor.SelectionLength = 0;
                           

                        }
but I have one problem: this check is ok but on every text changed event it checks all of the text so it bugs.
I used this script on document load. Can anybody help me make this script work for only the
line you are writing in
example:
if you write in line 1 it only checks line 1

Thanks!

Answers (6)