I got some code that uses a delegate to pass the percentage of the operation.
But the delegate method is run on the same thread as the operation, which is a backgroundworker. So updating a progressbar in the delegate method is impossible without invocation.
Should I just invoke in the delegate method or is there a better way?
I didn’t really understand the example that is on msdn (it was in vb.net too which made it harder :/).
You could add something along the lines of the below to the form containing the progress bar.
This will check to see if an invoke is required.