高软玩家

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

  设置

   listView1.VirtualMode = true;
   listView1.RetrieveVirtualItem += ListView1_RetrieveVirtualItem;

 

    private void ListView1_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
        {
            e.Item = MyListView[e.ItemIndex];
        }

       List<ListViewItem> ListView = new List<ListViewItem>();

                    ListViewItem item = new ListViewItem();
                    item.Text = i.ToString();
                    item.SubItems.Add(temp[0]);
                    item.SubItems.Add(temp[1]);
                    item.SubItems.Add(temp[2]);
                    item.SubItems.Add(temp[3]);
                    item.SubItems.Add("等待任务");
                    ListView.Add(item);

 

           this.Invoke(new EventHandler(delegate
            {
                listView1.VirtualListSize = MyListView.Count;
                listView1.Invalidate();
            }));

           //滚动listview

            this.Invoke(new EventHandler(delegate
                {
                    MyListView[Listview_index].EnsureVisible();
                }));

System.Threading.Interlocked.Increment(ref NowThread);

posted on 2018-03-15 16:30  高软玩家  阅读(206)  评论(0编辑  收藏  举报