Exemple #1
0
 private void btnDisconnect_Click(object sender, EventArgs e)
 {
     client.SendMessage(new Common.Message(MessageTypes.UserJoinOrLeft, client.ID, tbName.Text, tbName.Text + " left the chat", false));
     client.CloseClient();
     btnDisconnect.Enabled = false;
     btnConnect.Enabled    = true;
     tbIPAddress.ReadOnly  = false;
     tbName.ReadOnly       = false;
     tbPort.ReadOnly       = false;
     btnSend.Enabled       = false;
     tbMessages.Clear();
     lbUsers.Items.Clear();
     cbMsgToAll.Checked = true;
     cbMsgToAll.Enabled = false;
 }