Hello dear experts
My problem is color of text in RichtTextBox
If I type the text in RTB and using this code:
It works perfect!
But if i try to import text from file using:
I have no result
Have any ideas why?
My problem is color of text in RichtTextBox
If I type the text in RTB and using this code:
Code:
public Boolean blueHighLight(String _word, int startCoordinate, int endCoordinate){
this.inputTextAreaRtb.SelectionStart = startCoordinate;
this.inputTextAreaRtb.SelectionColor = Color.DarkBlue;
this.inputTextAreaRtb.SelectionFont = new System.Drawing.Font(
"David",
12, FontStyle.Underline);
this.inputTextAreaRtb.SelectedText = _word;
}
But if i try to import text from file using:
Code:
String[] splitFindings = Regex.Split(_findigs, @"(?<=[ ])");
foreach(String word in splitFindings)
{
this.inputTextAreaRtb.Text += word;
String wordWithoutPunctuation=Regex.Replace(word,@"(\p{P})","").Trim();
if (this.blueHighLight(wordWithoutPunctuation, this.inputTextAreaRtb.Text.Length - word.Length, this.inputTextAreaRtb.Text.Length))
{
.....
}
Have any ideas why?
Comment