Traffic Light

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 7

Building traffic signal

Implementing Signal Control with


.NET Framework
INTRODUCTION

THIS PRESENTATION EXPLORES THE


OPTIMIZATION OF TRAFFIC FLOW THROUGH
SIGNAL
CONTROL USING THE .NET FRAMEWORK. WE
WILL
DISCUSS THE BENEFITS AND ADVANTAGES
DISADVANTAGES OF THIS APPROACH, AS WELL
AS BEST PRACTICES FOR
IMPLEMENTATION.
CODE
Private
Public Class Form1
Sub Timer1_Tick(sender As Object, e As EventArgs)
Handles Timer1.Tick
If PictureBox1.Visible Then
PictureBox1.Visible = False Private Sub Form1_Load(sender As Object, e As
PictureBox2.Visible = True EventArgs) Handles MyBase.Load
PictureBox3.Visible = False Timer1.Enabled = True
Timer1.Interval = 2000
If PictureBox2.Visible = True Then PictureBox1.Visible = True
Label1.ForeColor = Color.Yellow PictureBox2.Visible = False
Label1.Text = "WAIT" PictureBox3.Visible = False
End If End Sub
End Class
ElseIf PictureBox2.Visible Then
PictureBox1.Visible = False
PictureBox2.Visible = False
PictureBox3.Visible = True

If PictureBox3.Visible = True Then


Label1.ForeColor = Color.Green
Label1.Text = "GO"
End If

ElseIf PictureBox3.Visible Then


PictureBox1.Visible = True
PictureBox2.Visible = False
PictureBox3.Visible = False

If PictureBox1.Visible = True Then


Label1.ForeColor = Color.Red
Label1.Text = "STOP"
End If

End If
End Sub
OUTPUT
Used tools

1. Picture Box
2. Labels
3. Timer
4. Textbox
Conclusion
This is how we can create a simple traffic signal light project in
vb.net framework with picturebox
Thank you!

You might also like