Hi all
I have a limited understanding of delegates, so bear with me.
In my main Form, I have a listview control.
I also have a class inside the main namespace in which I perform actions on the listview (such as removing a row).
Problem is, the actions the class performs are time consuming, so in order for the Form to avoid freezing, I am executing the class's methods in a separate thread using a 'backGroundWorker'.
Here is where I get stuck. I now can't do anything with the listview because I get this exception:
"Cross-thread operation not valid: Control 'listOfViews' accessed from a thread other than the thread it was created on."
So, I figure that delegates are the answer. I know how to do it in the same class, but I can't figure out how to do it when the actions are performed in a different class.
I would very much appreciate any help !!
Thanks in advance.