private void UserMessageBox_Click(object sender, EventArgs e) { if (UserMessageBox.Text.Equals("Enter your message . . .")) { UserMessageBox.Clear(); } }
private void SendMessageBtn_Click(object sender, EventArgs e) { string message = UserMessageBox.Text.Trim(' ', '\n'); if (message.Contains('\n')) { message = "\n" + message; } Client.WriteMessage(Client.Name + ": " + message); UserMessageBox.Clear(); }
private void UserMessageBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (UserMessageBox.Text.Equals("!clear")) { MessageArea.Clear(); } else { Network.Send(UserMessageBox.Text); } UserMessageBox.Clear(); } }