日期:2014-05-17 浏览次数:21303 次
private BackgroundWorker searchKey = new BackgroundWorker();
private void Button_Click(object sender, EventArgs e)
{
string [] st=new string[2];
st[0] = this.Item.Text;
st[1] = this.Info.Text;
searchKey.RunWorkerAsync(st);
}
private void searchKey_DoWork(object sender, DoWorkEventArgs e)
{
string[] st = new string[2];
st[0] = ((string[])(e.Argument))[0];
st[1] = ((string[])(e.Argument))[1];
/*中间省略N步*/
ListViewItem lv = new ListViewItem(new string[] { list[1], list[2], list[3], list[4] });
lv.ImageKey = list[0];
lv.Tag = list[5];
this.searchKey.ReportProgress(100, lv);
}
private void searchKey_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
/*e.UserState
this.listView.Items.Add();这里面我想加载到ListView控件里*/
}