private void UpdateServerListBox(string from, string message) { if (this.InvokeRequired == true) { MarshallMessage d = new MarshallMessage(UpdateServerListBox); this.Invoke(d, from, message); } else { Messages.Items.Add(from + " " + message); button2.Enabled = ConnectedToServer; if (button2.Enabled == true) { button1.Text = "Disconnect"; txtIPAddress.Enabled = false; txtPort.Enabled = false; IsConnected = true; } else { button1.Text = "Connect"; txtIPAddress.Enabled = true; txtPort.Enabled = true; IsConnected = false; } txtCommand.Enabled = ConnectedToServer; } }
private void UpdateServerListBox(string from, string message) { if (this.InvokeRequired == true) { MarshallMessage d = new MarshallMessage(UpdateServerListBox); this.Invoke(d, from, message); } else { Messages.Items.Add(from + " " + message); } }