You are on page 1of 2

Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer2.Stop() Timer3.Stop() Timer4.

Stop() Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick PictureBox1.Top -= 5 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Timer1.Stop() Timer2.Stop() Timer4.Stop() Timer3.Start() End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick PictureBox1.Top += 5 End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Timer1.Stop() Timer3.Stop() Timer4.Stop() Timer2.Start() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Timer1.Stop()

Timer3.Stop() Timer2.Stop() Timer4.Start() End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick PictureBox1.Left -= 5 End Sub Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick PictureBox1.Left += 5 End Sub Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Timer1.Stop() Timer2.Stop() Timer3.Stop() Timer4.Stop() End Sub Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click End Sub Private Sub PictureBox1_Move(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.Move Me.Label1.Text = PictureBox1.Location.ToString If PictureBox1.Location.X = 0 Then Timer3.Stop() MsgBox("fin del camino") End If If PictureBox1.Location.X = 435 Then Timer4.Stop() MsgBox("fin del camino") End If If PictureBox1.Location.Y = -1 Then Timer1.Stop() MsgBox("fin del camino") End If If PictureBox1.Location.Y = 284 Then Timer2.Stop() MsgBox("fin del camino") End If End Sub End Class

You might also like