示例#1
0
 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);
     }
 }
示例#2
0
 private void ClearList()
 {
     if (ClientsList.InvokeRequired)
     {
         ClientsList.BeginInvoke(new Action(() => { ClientsList.Items.Clear(); }));
     }
     else
     {
         ClientsList.Items.Clear();
     }
 }
示例#3
0
 private void AddToList(String name)
 {
     if (ClientsList.InvokeRequired)
     {
         ClientsList.BeginInvoke(new Action(() => { ClientsList.Items.Add(name); }));
     }
     else
     {
         ClientsList.Items.Add(name);
     }
 }
示例#4
0
 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;
     }
 }