首页  编辑  

RichEdit得到被替换的文字

Tags: /C#/界面处理/TextBox_RichEdit/   Date Created:

private string oldSelectedText = "" ;

private string curSelectedText = "" ;

private void richTextBox1_SelectionChanged( object sender , EventArgs e)

{

   oldSelectedText = curSelectedText; //

   curSelectedText = (( RichTextBox )sender) . SelectedText;

}

private void richTextBox1_TextChanged( object sender , EventArgs e)

{

   Text = " + oldSelectedText;

}