RichTextBox高亮显示 输入内容时滚动条不停的滚动,文本也在闪烁
private void tSql_TextChanged(object sender, EventArgs e)
{
string tokens = "(module|export|define|include|record|gen_tcp:listen|io:fwrite|lists:foreach|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|if|static|while)";
            Regex rex = new Regex(tokens);
            MatchCollection mc = rex.Matches(tSql.Text);
            int StartCursorPosition = tSql.SelectionStart;
            foreach (Match m in mc)
            {
                int startIndex = m.Index;
                int StopIndex = m.Length;
                tSql.Select(startIndex, StopIndex);
                tSql.SelectionColor = Color.Blue;
                tSql.Select(StartCursorPosition, 0);
                //tSql.SelectionStart = StartCursorPosition;
                tSql.SelectionColor = Color.Black;
            }
}
请帮助我,输入内容时,怎样让内容不闪烁,滚动条不自动滚动,非常感谢。