代码:
private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode ==Keys.Enter ) //回车键判断
{
if (textBox1.Text == richTextBox1.Text)
{ richTextBox1.Clear();}
}
}
想做到的是RichTextBox中录入的文字和TextBox中的文本相同的时候,RichTextBox中的文字清空,可是实际执行的时候,因为有回车键,虽然RichTextBox清空了,但是光标的位置总是在第二行