另外开一个线程就行了
由于时间关系,我用listBox代替,原理是一样的:
先using System.Threading;
下面是代码
private void Form1_Load(object sender, EventArgs e)
{
CheckForIllegalCrossThreadCalls = false;
Thread th = new Thread(new ThreadStart(listAdd));
th.Start();
}
protected void listAdd()
{
for (int i = 0; i < 1000000; i++)
{
//这里添加你的代码
listBox1.Items.Add(i);
}
}
使用 ListView的"虚拟模式"来解决.具体解决方法请百度一下. " ListView 虚拟模式"
我没有提过那种问题