Exemplo n.º 1
0
 /// <summary>在ListBox中移除状态信息</summary>
 /// <param name="user">要移除的信息</param>
 private void RemoveItemFromUserBox(string user)
 {
     if (L_ClientList.InvokeRequired)
     {
         RemoveItemFromUserBoxDelegate d = RemoveItemFromUserBox;
         L_ClientList.Invoke(d, user);
     }
     else
     {
         L_ClientList.Items.Remove(user);
         L_ClientList.SelectedIndex = L_ClientList.Items.Count - 1;
         L_ClientList.ClearSelected();
     }
 }
Exemplo n.º 2
0
 /// <summary>在ListBox中追加状态信息</summary>
 /// <param name="user">要追加的信息</param>
 private void AddItemToUserBox(string user)
 {
     if (L_ClientList.InvokeRequired)
     {
         AddItemToUserBoxDelegate d = new AddItemToUserBoxDelegate(AddItemToUserBox);
         L_ClientList.Invoke(d, new object[] { user });
     }
     else
     {
         L_ClientList.Items.Add(user);
         L_ClientList.SelectedIndex = L_ClientList.Items.Count - 1;
         L_ClientList.ClearSelected();
     }
 }