private void txtMsg_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { this.btnSendMsg_Click(sender, e); } }