Problem with color text in RichTextBox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alex berd
    New Member
    • Dec 2010
    • 4

    Problem with color text in RichTextBox

    Hello dear experts

    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;
    }
    It works perfect!

    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))
                    {
                        .....
                    }
    I have no result

    Have any ideas why?
  • EARNEST
    New Member
    • Feb 2010
    • 128

    #2
    please use CODE tags

    Comment

    • alex berd
      New Member
      • Dec 2010
      • 4

      #3
      Sorry i`ve change the question

      Comment

      • alex berd
        New Member
        • Dec 2010
        • 4

        #4
        Sorry i`ve change the question

        Comment

        Working...