Use a timer to refresh the progress bar. This is actually a very simple thing to do with the new framework. Have a method called ProgressBarUpdate or whatever you want to call it. Set it up like this:
Sub ProgressBarUpdate(value as Auto)
Dim mValue as Integer = value
ProgressBar1.value = value
End Sub
Now from your thread you execute this call whenever you want to update the progress bar:
dim mValue as Auto = SomeIntegerVariableOrProperty
Xojo.Core.Timer.Calllater(0, AddressOf ProgressBarUpdate, mValue)
Now the timer will fire on the main thread and update your progress bar accordingly.
Sure. But a progress wheel is always spinning and doesn’t need updates. So start the progress wheel when you start the thread. Then stop the progress wheel when the thread finishes.