I have this code:
It basically looks for the errorString and changes its text to red. Is there a better way of doing this? When there is over 1000 of the target string, it takes quite a long time.Code:private void markError(string errorString, System.Drawing.Color color) { int lastStrLoc = 0; int strLoc = 0; int errorStrLen = errorString.Length; while((strLoc = rtbResult.Find(errorString, lastStrLoc, RichTextBoxFinds.None)) != -1) { lastStrLoc = strLoc + 1; rtbResult.Select(strLoc, errorStrLen); rtbResult.SelectionColor = color; } }




Reply With Quote