Traffic Light Interface Design
-: Tools Used : -
1. label as Counter
2. OvalShape as Redlight, GreenLight and YellowLight
3. 2 Timer controls as Timer and TimerNext
Source code for "Traffic Light Interface Design"
Public Class Form2 'Class Declaration
Private Sub Timer_Tick(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
Timer.Tick
Counter.Text = Counter.Text - 1
If Counter.Text
= 12 Then
Counter.ForeColor = Color.Yellow
YellowLight.BackColor = Color.Yellow
RedLight.BackColor = Color.Black
ElseIf
Counter.Text = 0 Then
GreenLight.BackColor = Color.Green
Counter.ForeColor = Color.Green
YellowLight.BackColor = Color.Black
Timer.Enabled = False
Counter.Text = 70
TimerNext.Enabled = True
End If
End Sub
Private Sub TimerNext_Tick(ByVal
sender As System.Object,
ByVal e As
System.EventArgs) Handles
TimerNext.Tick
Counter.Text = Counter.Text - 1
If
Counter.Text = 12 Then
Counter.ForeColor = Color.Red
ElseIf
Counter.Text = 0 Then
GreenLight.BackColor = Color.Black
Counter.ForeColor = Color.Red
RedLight.BackColor = Color.Red
TimerNext.Enabled = False
Counter.Text = 70
Timer.Enabled = True
End If
End Sub
End Class
1 comment:
Traffic control course melbourne Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.
Post a Comment