VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "自动红黄绿灯模拟程序"
   ClientHeight    =   2640
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4380
   LinkTopic       =   "Form1"
   ScaleHeight     =   2640
   ScaleWidth      =   4380
   StartUpPosition =   3  '窗口缺省
   Begin VB.HScrollBar HScroll3 
      Height          =   255
      Left            =   3120
      Max             =   10
      Min             =   1
      TabIndex        =   6
      Top             =   2040
      Value           =   1
      Width           =   1215
   End
   Begin VB.HScrollBar HScroll2 
      Height          =   255
      Left            =   3120
      Max             =   10
      Min             =   1
      TabIndex        =   5
      Top             =   1560
      Value           =   1
      Width           =   1215
   End
   Begin VB.HScrollBar HScroll1 
      Height          =   255
      Left            =   3120
      Max             =   10
      Min             =   1
      TabIndex        =   4
      Top             =   1080
      Value           =   1
      Width           =   1215
   End
   Begin VB.Timer Timer2 
      Interval        =   100
      Left            =   960
      Top             =   240
   End
   Begin VB.Timer Timer1 
      Interval        =   100
      Left            =   360
      Top             =   240
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "绿"
      Height          =   180
      Left            =   2880
      TabIndex        =   3
      Top             =   2040
      Width           =   180
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "黄"
      Height          =   180
      Left            =   2880
      TabIndex        =   2
      Top             =   1560
      Width           =   180
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "红"
      Height          =   180
      Left            =   2880
      TabIndex        =   1
      Top             =   1080
      Width           =   180
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Label1"
      Height          =   375
      Left            =   1440
      TabIndex        =   0
      Top             =   2040
      Width           =   1335
   End
   Begin VB.Image Image4 
      Height          =   615
      Left            =   1920
      Top             =   1080
      Width           =   615
   End
   Begin VB.Image Image5 
      Height          =   480
      Left            =   1080
      Picture         =   "sy07-08.frx":0000
      Top             =   1080
      Width           =   480
   End
   Begin VB.Image Image1 
      Height          =   480
      Left            =   2160
      Picture         =   "sy07-08.frx":0442
      Top             =   240
      Width           =   480
   End
   Begin VB.Image Image2 
      Height          =   480
      Left            =   3000
      Picture         =   "sy07-08.frx":0884
      Top             =   240
      Width           =   480
   End
   Begin VB.Image Image3 
      Height          =   480
      Left            =   3720
      Picture         =   "sy07-08.frx":0CC6
      Top             =   240
      Width           =   480
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer

Private Sub Form_Load()
    Timer2.Enabled = True
    Timer1.Enabled = False
    Image1.Visible = False
    Image2.Visible = False
    Image3.Visible = False
    Image5.Visible = False
End Sub

Private Sub Timer1_Timer()
    If i = 0 Then
        Timer1.Interval = HScroll1.Value * 1000
        i = (i + 1) Mod 3
        Image4.Picture = Image1.Picture
    ElseIf i = 1 Then
        Timer1.Interval = HScroll2.Value * 1000
        i = (i + 1) Mod 3
        Image4.Picture = Image2.Picture
    ElseIf i = 2 Then
        Timer1.Interval = HScroll3.Value * 1000
        i = (i + 1) Mod 3
        Image4.Picture = Image3.Picture
    End If
End Sub

Private Sub Timer2_Timer()
    Dim str As String
    str = Time$
    Label1.Caption = str
    If Val(str) >= 21 Or Val(str) < 2 Then
        Timer1.Enabled = False
        Image4.Picture = Image5.Picture
    Else
        Timer1.Enabled = True
    End If
End Sub
