I have a button inside a form. The button moves horizontally from one point to another by continuously varying the Button.Location.X from 0 to 1000 using a timer. See code below.
Timer1.Interval = 100
Dim i as Integer = -1
Private Sub Timer1_tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Button1.Location = New Point(i, 50)
If i = 1000
i = 0
End If
i = i + 1
End Sub
Now the problem is while the button is moving it flickers. How do I stop the flickering?
Tried using Hans Passant's answer to this question but it's not working.