2
Reply

Call a method from UI in another Thread

Gerben Schmidt

Gerben Schmidt

Jan 21 2011 2:41 PM
13.6k
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...


Answers (2)