You are on page 1of 1

Put an image of a car and set the stretch properties to false.

and name it imgCar and tree


same as tree on properties and don’t name it and a timer control and its interval to 1 and
enable false like the bottom picture
1. Under command button click event put the following code:

If Command1.Caption = "Start" Then


Command1.Caption = "Stop"
Timer1.Enabled = True
Else
Command1.Caption = "Start"
imgCar.Left = 4800
imgCar.Top = 120
Timer1.Enabled = False
End If
1. Under timer event put the following code
If imgCar.Left > 2040 Then
imgCar.Move imgCar.Left - 10, imgCar.Top + 5
End If

You might also like