Help, it is necessary that when you press the enter key, a message from the textbox is sent, and in the textboxe itself, the cursor does not move to a new line

    1 answer 1

    Sign up for a KeyDown :

     private void textBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { e.SuppressKeyPress = true; // отправка сообщения } }