I have this code :
var task = System.Threading.Tasks.Task.Factory.StartNew(() =>
{
// Code...
Invoke(new Action(() => progressBar.Increment(1)));
// Code...
});
task.Wait();
But the Invoke fail, without Exception or any kind of error. It seems that the "wait" prevents the refresh of the form, probably because I'm still in the method.
how do I get around this?
Thanks