private void SetIndexByName(String name) { if (ClientsList.InvokeRequired) { ClientsList.BeginInvoke(new Action(() => { ClientsList.SelectedIndex = ClientsList.Items.IndexOf(name); })); } else { ClientsList.SelectedIndex = ClientsList.Items.IndexOf(name); } }
private void ClearList() { if (ClientsList.InvokeRequired) { ClientsList.BeginInvoke(new Action(() => { ClientsList.Items.Clear(); })); } else { ClientsList.Items.Clear(); } }
private void AddToList(String name) { if (ClientsList.InvokeRequired) { ClientsList.BeginInvoke(new Action(() => { ClientsList.Items.Add(name); })); } else { ClientsList.Items.Add(name); } }
public void ChEn(Boolean st) { State = st; if (ClientsList.InvokeRequired) { ClientsList.BeginInvoke(new Action(() => { ClientsList.Enabled = st; })); } else { ClientsList.Enabled = st; } if (ClientsScan.InvokeRequired) { ClientsScan.BeginInvoke(new Action(() => { ClientsScan.Enabled = st; })); } else { ClientsScan.Enabled = st; } }