listView1.BeginUpdate();


                
foreach (FileInfo f in Dir.GetFiles("*.*"))       //查找文件

                {       



                  listView1.Items.Add(Dir 
+ f.ToString());   //listBox1中填加文件名



                    listView1.Items[j].SubItems.Add(f.Length.ToString());



                    j 
= j + 1;                    

                }

                listView1.EndUpdate();

 

 

 

重点就是这两组配对出现在循环中,这样就不会在线程中闪了
ListView1.BeginUpdate();
ListView1.EndUpdate();

参考:
http://msdn.microsoft.com/zh-cn/library/system.windows.forms.listview.beginupdate(VS.80).aspx

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2021-08-03
  • 2021-08-02
猜你喜欢
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2021-08-19
  • 2021-10-11
  • 2022-02-13
  • 2021-07-19
相关资源
相似解决方案