private void TextBox_Message_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { TextBox_Message.Clear(); } }
private void Button_Send_Click(object sender, EventArgs e) { String message = TextBox_Message.Text; Send(message); TextBox_Chat.AppendText(message + Environment.NewLine); TextBox_Message.Clear(); }
private void TextBox_Message_KewDown(object sender, KeyEventArgs e) { if ((e.Key == Key.Enter) && (TextBox_Message.Text.Length != 0)) { _workWithMessage.SendMessage(TextBox_Message.Text); AppendMyMessage(TextBox_Message.Text); TextBox_Message.Clear(); } }
/*================ * События * ================*/ private void Button_ToSend_Click(object sender, RoutedEventArgs e) { if (TextBox_Message.Text.Length != 0) { _workWithMessage.SendMessage(TextBox_Message.Text); AppendMyMessage(TextBox_Message.Text); TextBox_Message.Clear(); } }
private void Button_Send_Click(object sender, EventArgs e) { if (CheckBox_Command.Checked == true && TextBox_Message.Text == "QUIT") { ErrorMessage("Please use the disconnect button to quit."); return; } if (CheckBox_Command.Checked == true) { client.Send(TextBox_Message.Text); ShowMessage("[C]" + client.Nick + " : " + TextBox_Message.Text); TextBox_Message.Clear(); TextBox_Message.Focus(); } else { client.SendMessage(TextBox_Message.Text.Trim()); ShowMessage("[M]<" + client.Nick + "> " + TextBox_Message.Text); TextBox_Message.Clear(); TextBox_Message.Focus(); } }