Remove the last line (listView1.Items.Add (abg); // ERROR here?) From your code and replace it with this:
AddListViewItem(abg);
Then this method for your code:
delegate void AddListViewItemDelegate(ListViewItem abg); void AddListViewItem(ListViewItem abg) { if (this.InvokeRequired) { AddListViewItemDelegate del = new AddListViewItemDelegate(AddListViewItem); this.Invoke(del, new object() { abg }); } else { listView1.Items.Add(abg); } }
It will do the job, happy walking!
source share