I have a code that fetches tweets from a specific Twitter account using Tweetsharp library, creates instance of a custom UserControl
and post t
You get this exception because your background worker uses a new thread, and this thread is different than the main UI thread. To simplify the error message says that you cannot change your UI element from another thread, they are independant.
This answer will solve your problem.
I also found this answer from @Marc Gravell
///...blah blah updating files
string newText = "abc"; // running on worker thread
this.Invoke((MethodInvoker)delegate {
someLabel.Text = newText; // runs on UI thread
});
///...blah blah more updating files