by Edward F. O'Connor, Jr ()
Category: Graphics
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 10th January 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Name of program is Stop & Go Lights. This code will turn on and off timers that also will make three different images visible true or false,
tmrRedLight.Enabled = True
End Sub
Private Sub tmrRedLight_Timer()
'Red light code.
If imgRedLight.Visible = False Then
imgRedLight.Visible = True
tmrYellowLight.Enabled = False
tmrGreenLight.Enabled = False
lblRed.Visible = True
lblYellow.Visible = False
lblGreen.Visible = False
Else
If imgRedLight.Visible = True Then
imgRedLight.Visible = False
tmrRedLight.Enabled = False
tmrYellowLight.Enabled = True
tmrGreenLight.Enabled = False
lblRed.Visible = False
lblYellow.Visible = False
lblGreen.Visible = False
End If
End If
End Sub
Private Sub tmrYellowLight_Timer()
'Yellow light code.
If imgYellowLight.Visible = False Then
imgYellowLight.Visible = True
tmrRedLight.Enabled = False
tmrGreenLight.Enabled = False
lblRed.Visible = False
lblYellow.Visible = True
lblGreen.Visible = False
Else
If imgYellowLight.Visible = True Then
imgYellowLight.Visible = False
tmrRedLight.Enabled = False
tmrYellowLight.Enabled = False
tmrGreenLight.Enabled = True
lblRed.Visible = False
lblYellow.Visible = False
lblGreen.Visible = False
End If
End If
End Sub
Private Sub tmrGreenLight_Timer()
'Green light code.
If imgGreenLight.Visible = False Then
imgGreenLight.Visible = True
tmrRedLight.Enabled = False
tmrYellowLight.Enabled = False
tmrGreenLight.Enabled = True
lblRed.Visible = False
lblYellow.Visible = False
lblGreen.Visible = True
Else
If imgGreenLight.Visible = True Then
imgGreenLight.Visible = False
tmrRedLight.Enabled = True
tmrYellowLight.Enabled = False
tmrGreenLight.Enabled = False
lblRed.Visible = False
lblYellow.Visible = False
lblGreen.Visible = False
End If
End If
End Sub
Private Sub cmdStop_Click()
tmrRedLight.Enabled = False
tmrYellowLight.Enabled = False
tmrGreenLight.Enabled = False
imgRedLight.Visible = False
imgYellowLight.Visible = False
imgGreenLight.Visible = False
lblRed.Visible = False
lblYellow.Visible = False
lblGreen.Visible = False
End Sub
Private Sub cmdExit_Click()
End
End Sub
No comments have been posted about Name of program is Stop & Go Lights. This code will turn on and off timers that also will make thre. Why not be the first to post a comment about Name of program is Stop & Go Lights. This code will turn on and off timers that also will make thre.