I have searched the site and found similiar topics, but my problem is that the explanation / solution is a bit beyond my technical understanding at the moment.
I have only just noticed a “Background Worker” in Visual Studio, and I am using it to login to my database and keep the UI functioning (GIF image to show loading etc).
Problem I am having is that once the login is complete i am updating a label to say “login Complete” etc.
I am getting an error “Cross thread operation not valid”
If possible, could anybody tell me a way i can update a control via the Background Worker, or provide a source that I can use as a resource?
I have never used multi threading before, i understand the reason for the problem, but I dont see how to work around it.
Thanks for your time!
Tom
You have to update your display in the
BackgroundWorkerevent handlers for theProgressChangedandRunWorkerCompletedevents. This will eliminate the cross-thread problems you are experiencing.http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx#Y2497.