public void Receive(string _content, Font temp) { if (flp_messeage.InvokeRequired) { this.Invoke(new ReceiveDelegate(Receive), _content, temp); } else { if (_content != "") { Messeage ms = new Messeage(_cm.userName, _content, temp); flp_messeage.Controls.Add(ms); } } }
private void bbt_gui_Click(object sender, EventArgs e) { if (_cm.socket.Connected) { if (rTB_content.Text != "") { Messeage ms = new Messeage("Server", rTB_content.Text, text); flp_messeage.Controls.Add(ms); text = rTB_content.Font; Command cmd = new Command(Enum.CommandType_.Message,rTB_content.Text,text); rTB_content.Text = ""; _cm.SendCommand(cmd); } } else { MessageBox.Show("Kết nối với client đã bị đóng!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void bbt_gui_Click(object sender, EventArgs e) { if (_cm.socket.Connected) { if (rTB_content.Text != "") { Messeage ms = new Messeage("Server", rTB_content.Text, text); flp_messeage.Controls.Add(ms); text = rTB_content.Font; Command cmd = new Command(Enum.CommandType_.Message, rTB_content.Text, text); rTB_content.Text = ""; _cm.SendCommand(cmd); } } else { MessageBox.Show("Kết nối với client đã bị đóng!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }