Ejemplo n.º 1
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();
     }
 }
Ejemplo 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();
     }
 }