TextRange range = richtextbox1.Selection;
            string text = range.Text; 
            richtextbox1.Selection.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Red);     

解决方案 »

  1.   


    谢谢前辈,但我看不明白,能不能给我解释一下,谢谢了    TextRange range = richtextbox1.Selection;  //获取选中项 
                string text = range.Text;  //选中的文本内容
                richtextbox1.Selection.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Red);//选中的文本设为红色
      

  2.   

        TextRange range = richtextbox1.Selection;  //获取选中项 
                string text = range.Text;  //选中的文本内容
    richtextbox1.Selection.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Red);//选中的文本设为红色前面两行和最后一行有什么联系吗,第二次依然没办法选中我需要的字符。
      

  3.   

    感觉ApplyPropertyValue后,文本被分成两段了。
      

  4.   

    http://www.cnblogs.com/xiarifeixue/archive/2010/12/14/1905288.html