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