79290722

Date: 2024-12-18 10:17:31
Score: 0.5
Natty:
Report link

Use textBox KeyDown event.

private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13) // on enter
            {
                listBox1.Items.Add(textBox1.Text);
                textBox1.Focus();
                textBox1.Text = "";
            }
        }
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: AmirABD