Check all item in listview with huge list item?

前端 未结 6 862
情书的邮戳
情书的邮戳 2021-01-25 06:19

I want to check about 3000 item in listview. This is a bit of code :

foreach (ListViewItem item in this.lvItem.Items)
{
    item.Checked = !item.Ch         


        
6条回答
  •  天涯浪人
    2021-01-25 06:58

    I heard a rumor that for large list items a for loop will work faster than a foreach loop try

    for(int i = 0; i = < this.1vItem.Items.Count; i++)
    {
    //Stuff
    }
    

提交回复
热议问题