private void SendTxt_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { SendBtn.PerformClick(); e.SuppressKeyPress = true; } }
private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 13) { SendBtn.PerformClick(); e.Handled = true; e.SuppressKeyPress = true; } }