I am trying to pass in a delegate using an anonymous method into progressBar.Invoke(Delegate):
progressBar.Invoke(() => progressBar.Value = count);
But I get the following error:
Cannot convert lambda expression to type ‘System.Delegate’ because it is not a delegate type.
Could someone please explain what I am doing wrong?
That method takes a Delegate, not an Action. Therefore, when you do just this:
It doesn’t know what delegate you want. Do this instead: