怎么判断richtextbox光标选中区域有没有回车符?

解决方案 »

  1.   

    判断richettextbox 的text 最后是否存在\r\t
      

  2.   

    int pos=richTextBox1.Find(str);
    richTextBox1.SelectionStart=pos;
    richTextBox1.SelectionLength=str.Length;   
    contains("\r\n")
      

  3.   

            private void timer1_Tick(object sender, EventArgs e)
            {
                string text = richTextBox1.SelectedText;
                if (text.Contains("\n") == true)
                {
                    //MessageBox.Show("contain enter key");
                    Console.WriteLine("contain enter key");
                }
            }