I want my background worker to add items to a list box, it appears to do so when debugging but the listbox doesn\'t show the values. I suspect this is something to do with a
I add functions like the following so that I can add items to the list box from either the main thread or background threads. Thi thread checks if a Invoke is necessary and then uses Invoke if it is necessary.
delegate void AddListItemDelegate(string name,object otherInfoNeeded);
private void
AddListItem(
string name,
object otherInfoNeeded
)
{
if (InvokeRequired)
{
BeginInvoke(new AddListItemDelegate(AddListItem), name, otherInfoNeeded
return;
}
... add code to create list box item and insert in list here ...
}