Hi,
In a running thread (Async Backgroundworker) I wan't to get selected listbox items from the UI.
In my current code the background worker starts but when I call the method in the DOWORK it get's an exeption:
"Cross-thread operation not valid: Control 'listBox1' accessed from a thread other than the thread it was created on."
What is the solution?
I am a beginner...
Call a method from UI in another Thread
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Roy S194 reputationPosted Jan 21, 2011, 9:56 AM EST
http://stackoverflow.com/questions/4429354/how-to-edit-windows-forms-controls-from-different-threads
In short: you could use
listBox1.Invoke(new Action(delegate() { /* What you need to do with the listbox */ } ));
Gerben Schmidt7 reputationPosted Jan 21, 2011, 10:47 AM EST