Torna al Thread
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
GoingUp = True
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
GoingUp = False
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GoingUp = False Then
While PicBox.Location.Y + PicBox.Size.Height < Me.Size.Height
PicBox.Location = New Point(PicBox.Location.X, PicBox.Location.Y + 1)
End While
Else
While PicBox.Location.Y > 0
PicBox.Location = New Point(PicBox.Location.X, PicBox.Location.Y - 1)
End While
End If
End Sub