You will need a counter (total) that starts at 0 and that you increase (with a lock) at the end of each part.
And then you need
- raises an event and the event should use Invoke (or Dispatch)
- or periodically the timer selects the counter
Option 2) is simpler and more efficient when the number of iterations is large.
source share