slow code inside timer

… I have a timer control that moves the buttons from left to right like this

Do
For i=0 to 6
Button(i).left=button(i).left +1
Next
Loop until button(0).left> window1.width

Very basic code but its very slow EVEN WITH TIMER PERIOD AT 1 !
Any ideas why its so slow ?

You are fighting the display. Your timer is sucking up all the resources on the main thread due to the use of Do…Loop inside the timer, which is totally unnecessary. Remove the loop. Each time the timer fires, move the controls by one, then exit. That will allow a more natural action. As it is, your timer only fires once and then does all the work in one go, which defeats the use of the timer altogether.