using System.Windows.Forms;

namespace _9_2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (textBox1.Text != string.Empty && e.KeyChar == 13)
            {
                listBox1.Items.Add(textBox1.Text);
                textBox1.Text = string.Empty;
            }
        }
    }
}