示例#1
0
 private void UserMessageBox_Click(object sender, EventArgs e)
 {
     if (UserMessageBox.Text.Equals("Enter your message . . ."))
     {
         UserMessageBox.Clear();
     }
 }
示例#2
0
        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();
        }
示例#3
0
        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();
            }
        }