Code
Procedure Progress(*x)
While a=0
SetGadgetState(2, Value)
Delay(10)
If Value=100:Value=0:EndIf
Value+1
Wend
EndProcedure
OpenWindow(0, 0, 0, 400, 100, "Create Thread", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ProgressBarGadget(2, 10, 10, 380, 20, 0, 100)
CreateThread(@Progress(), 0)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow