title: How do I make a PictureBox jump in Visual Basic?
body: <p>I have an assignment for school where I have an animated character that runs.  I need to be able make him jump and return to the spot he started the jump after a button press.  I have a timer that switches images to animate the character.  There are also buttons to speed up, slow down, start, and stop the character.  I'm having trouble because I think I have to integrate the timer into the button press and I'm not too sure how to to that.  There is a space at the bottom of the code where the jump button is.  I'm able to make him go up but can't figure out how to make him come back down.    </p>
  
  <p>Here is my code so far:  </p>
  
  <pre><code>Private Sub tmrSpeed_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSpeed.Tick
  
      Static Dim intCounter As Integer 
  
      picRunner.Location = New Point(picRunner.Location.X + 15, picRunner.Location.Y)
  
      If picRunner.Location.X &gt;= 523 Then
          picRunner.Location = New Point(-25, picRunner.Location.Y)
      End If
  
      Select Case intCounter
          Case 0
              Me.picRunner.Image = My.Resources.r0
          Case 1
              Me.picRunner.Image = My.Resources.r1
          Case 2
              Me.picRunner.Image = My.Resources.r2
          Case 3
              Me.picRunner.Image = My.Resources.r3
          Case 4
              Me.picRunner.Image = My.Resources.r4
          Case 5
              Me.picRunner.Image = My.Resources.r5
          Case 6
              Me.picRunner.Image = My.Resources.r6
          Case 7
              Me.picRunner.Image = My.Resources.r7
          Case 8
              Me.picRunner.Image = My.Resources.r8
          Case 9
              Me.picRunner.Image = My.Resources.r9
      End Select
  
      intCounter += 1
  
      If intCounter &gt;= 10 Then  
          intCounter = 0
      End If
  
  
      End If
  
  End Sub
  
  Private Sub btnFaster_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFaster.Click
  
      Try  
          Me.tmrSpeed.Interval = Me.tmrSpeed.Interval - 10
      Catch x As Exception
          MessageBox.Show("He can't run any faster!")
      End Try
  
  End Sub
  
  Private Sub btnSlower_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSlower.Click
  
      Me.tmrSpeed.Interval = Me.tmrSpeed.Interval + 10
  
  End Sub
  
  Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
  
      Me.tmrSpeed.Stop()
  
  End Sub
  
  Private Sub btnRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRun.Click
  
      Me.tmrSpeed.Start()
  
  End Sub
  
  Private Sub btnJump_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnJump.Click
  
  
  End Sub
  End Class
  </code></pre>
  
  <p>How would I go about implementing the jump?  My teacher says I have to use a loop, obviously to check when the picturebox reaches a certain hot but I can't figure out how to use this with the timer.  Any help would be appreciated. </p>