日期:2014-05-18 浏览次数:20899 次
private void Add_Text(string s) { if (this.listView1.InvokeRequired) { this.Invoke(new AddText(Add_Text),new object[]{s}); return; } this.listView1.Items.Add(s); } private void AddItem() { for (int i = 0; i < 10; i++) { Add_Text(i.ToString()); } } private void button1_Click(object sender, EventArgs e) { Thread th = new Thread(new ThreadStart(AddItem)); th.Start(); }
------解决方案--------------------