Progress Bar updation

You can try this:

Create a thread (you can set a high priority if you need) and add your loop there.
In the end of the loop put:

Timer.CallLater 0, WeakAddressOf InstanceMethodThatRefreshesProgressbar

The InstanceMethodThatRefreshesProgressbar method will be called every time when it’s possible since 0 means “execute in the next event loop” (add the method to a window or something)

From the method, Read the progress value from a property in the thread.

1 Like

How so? Simply move ALL your code into the thread. The long-running code will finish and then the next process will start. If you need multiple processes to run in sequence, while still leaving the UI responsive, put them all into the same thread. They will run in sequence.

You will need to ensure that the user can’t start some other process in the mean time. Disable buttons as needed.