Saturday, 14 July 2012

Traffic Lights - Visual Basic

This Traffic Light program is a Visual Basic program designed by Kassaye that works like the actual traffic light. It is a nice little program. In this program, you have to insert one timer and set its interval according to your wish. Here I set it to 3000, which is equivalent to 3 seconds. Next you insert three shapes and set their shape properties to circle and fill the colors. There it goes, your traffic light is working!

Here is The Code

Private Sub Timer1_Timer()
If Shape1.Visible Then

Shape2.Visible = True
Shape1.Visible = False
Shape3.Visible = False

ElseIf Shape2.Visible Then

Shape3.Visible = True
Shape2.Visible = False
Shape1.Visible = False


Shape1.Visible = True
Shape2.Visible = False
Shape3.Visible = False

End If

Share this:

Post a Comment

Please Do Not Spam

Back To Top
Copyright © 2014 Appupro. Designed by OddThemes