Пример #1
0
 private void SendTxt_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SendBtn.PerformClick();
         e.SuppressKeyPress = true;
     }
 }
Пример #2
0
        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                SendBtn.PerformClick();

                e.Handled          = true;
                e.SuppressKeyPress = true;
            }
        }