private void textBox2_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (client != null) { client.SendMsg(textBox2.Text, ID); client.NewMsg(ID, textBox2.Text, DateTime.Now.ToString()); textBox2.Text = ""; } } }