Moving Car

This is an animation program, an example of the timer control in Visual Basic 6, where a car goes towards a tree. After understanding this sample program, you can make some interesting animations on your own.

                                                                >> DOWNLOAD 

Moving Car animation using Timer control


Private Sub Command1_Click()
    If Command1.Caption = "Start" Then
        Command1.Caption = "Stop"
        Timer1.Enabled = True
        Command1.Caption = "Start"
        imgCar.Left = 4800
        imgCar.Top = 120
        Timer1.Enabled = False
    End If
End Sub
Private Sub Timer1_Timer()
    If imgCar.Left > 2040 Then
        imgCar.Move imgCar.Left - 10, imgCar.Top + 5
    End If
End Sub