As far as i understood, you want a thread, that does something and then reports back to the gui.
you can:
-throw an event from your thread and catch it in the gui.
But you still have to call Invoke in the event handler.
-define a function in the gui class that does all the changes to the gui and invokes itself if an invoke is required, then call this function from the thread:
Code:
delegate void UpdateGuiDelegate();
public void UpdateGui()
{
if (this.InvokeRequired)
{
UpdateGuiDelegate del = new UpdateGuiDelegate(AddressOf UpdateGui); //AddressOf is vb.net syntax, i forgot the C# syntax ^^
this.Invoke(del);
}
else
{
//do your gui work here
}
}
Invoke is a synchronous call, so in any case your thread will wait for the gui to finish its job. If you don't want that, you can call Control.BeginInvoke which is an asynchronous call.