Search code examples
vbabasic

How do I make it go left instead of right with a stopping point?


Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
    'Timer run from left to right to the number of input
     PictureBox1.Location = New Point(PictureBox1.Location.X + TextBox1.Text, PictureBox1.Location.Y)
End Sub

This is going right with no stopping point.


Solution

  • What about subtracting that TextBox value from the previous X position instead of adding it?

    Adding to an X coordinate will move the picture to the right, of course.