C#按Enter键焦点跳到文本框
在keypress事件中
private void richTextBox2_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { textbox.Focus(); } if (e.KeyChar == System.Convert.ToChar(13)) { e.Handled = true; } }
在keypress事件中
private void richTextBox2_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { textbox.Focus(); } if (e.KeyChar == System.Convert.ToChar(13)) { e.Handled = true; } }