private void OnSendMsgButtonClick(object sender, EventArgs e) { udpServer.SendMsg(SendMsgTextBox.Text); MessageDisplayTextBox.AppendText(SendMsgTextBox.Text + System.Environment.NewLine); MessageDisplayTextBox.Refresh(); Switch2FirstLine(); }
private void OnSendMsgButtonClick(object sender, EventArgs e) { udpClient.SendMsg(MessageTextBox.Text); MessageDisplayTextBox.AppendText(MessageTextBox.Text + "\r\n"); MessageDisplayTextBox.Refresh(); MessageTextBox.Clear(); }
private void OnMsgKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { udpServer.SendMsg(SendMsgTextBox.Text); MessageDisplayTextBox.AppendText(SendMsgTextBox.Text + System.Environment.NewLine); MessageDisplayTextBox.Refresh(); Switch2FirstLine(); } }
private void OnKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { udpClient.SendMsg(MessageTextBox.Text); MessageDisplayTextBox.AppendText(MessageTextBox.Text + "\r\n"); MessageDisplayTextBox.Refresh(); MessageTextBox.Clear(); } }
private void AppendToMessageDisplayTextBox(string text) { if (InvokeRequired) { BeginInvoke(new Action <string>(AppendToMessageDisplayTextBox), text); return; } MessageDisplayTextBox.AppendText(SetEnvironmentNewLineCharacters(text)); }
private void OnUpdateRecvMessage(string msg) { if (MessageDisplayTextBox.InvokeRequired) { UdpServer.OnReceivceMsg recvMessage = new UdpServer.OnReceivceMsg(OnUpdateRecvMessage); this.Invoke(recvMessage, msg); } else { MessageDisplayTextBox.AppendText(msg + System.Environment.NewLine); MessageDisplayTextBox.Refresh(); } }
private void OnUpdateRecvMessage(string msg) { if (MessageDisplayTextBox.InvokeRequired) { UdpClient.OnReceivceMsg recvMessage = new UdpClient.OnReceivceMsg(OnUpdateRecvMessage); this.Invoke(recvMessage, msg); } else { MessageDisplayTextBox.AppendText(msg + "\r\n"); MessageDisplayTextBox.Refresh(); } }
private void AppendTextToMessageDisplayTextBox(string text) { MessageDisplayTextBox.BeginInvokeOnUIThread(t => MessageDisplayTextBox.AppendText(t), text); }