Hi there

How exactly does Control.Invoke work?

How can i put this in my code?

I have a main form
I also have some classes which of one of them executes in a seperate thread. In that thread, there maybe a status update and I want to be able to update a label control on my main form with the new status text update.

so how do I make this work using invoking etc...? I do not seem to understand where the delegates and events etc... go.

so in total I have these:

Form which has UI Controls

several .cs class files, one class file is loaded/executes in a new Thread which is done from the Form when a user clicks on a button.

The class/method which is being executed in a different thread will update the text of a control (label) on the main Form. I would like to update the status of this text properly without the UI hanging/app crashing so I need to use delegates which makes it thread safe(r)....

how can I do this? Where do I place the code and what code should I use?


any help is much appreciated!