Code:
For x=0 to 10000
   if x mod 500=0 then form1.refresh:doevents
next x
This will refresh form1 20 times in 10000 loops