I have a button on my windows form that calls the RunWorkerAsync() method, this in turn performs an action which then updates a ListBox on the same form.
After the DoWork event has finished I assign the Result for the event (Which is a list), I process the RunWorkerCompleted() event and then perform the following code to update my Listbox

which calls this:

(Apologies, code formatting won’t work)
Now when I run the application and press the refresh button the following exception appears:

How would I get around this?
Edit:
The exception is thrown on the folowing statement, this occurs in the DoWork method where I clear the contents to keep the list up to date;
listBoxServers.Items.Clear();
Here’s a snippet which I find very handy:
You can pass it any delegate of
Actiontype or simply a lambda like this:or