This is a common problem with multi-threading.
It is only possible to change the properties of Components and Controls from the UI thread.
To change them from another thread, you must Invoke a method that does the change for you.
However, for what you are doing I do not think that Invoke is what you need.
You do not need to SetSelected on a ListBox item to get its value (unless you are relying on the result of a SelectionChanged event to do something else).
You can just reference the item directly from the ListBox.Items collection.
E.g. string[] details = {listBox4.Items[i].ToString(), listBox5.Items[i].ToString()};
nick.crane
Nearly a Posting Virtuoso
1,230 posts since Feb 2010
Reputation Points: 375
Solved Threads: 187