VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Form1 
   Caption         =   "自动红黄绿灯模拟程序"
   ClientHeight    =   2640
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4380
   LinkTopic       =   "Form1"
   ScaleHeight     =   2640
   ScaleWidth      =   4380
   StartUpPosition =   3  '窗口缺省
   Begin MSComCtl2.UpDown UpDown3 
      Height          =   375
      Left            =   3720
      TabIndex        =   5
      Top             =   1920
      Width           =   240
      _ExtentX        =   423
      _ExtentY        =   661
      _Version        =   393216
      AutoBuddy       =   -1  'True
      BuddyControl    =   "Text3"
      BuddyDispid     =   196611
      OrigLeft        =   3720
      OrigTop         =   1680
      OrigRight       =   3960
      OrigBottom      =   2415
      SyncBuddy       =   -1  'True
      BuddyProperty   =   0
      Enabled         =   -1  'True
   End
   Begin MSComCtl2.UpDown UpDown2 
      Height          =   375
      Left            =   3720
      TabIndex        =   4
      Top             =   1440
      Width           =   240
      _ExtentX        =   423
      _ExtentY        =   661
      _Version        =   393216
      BuddyControl    =   "Text2"
      BuddyDispid     =   196612
      OrigLeft        =   3720
      OrigTop         =   1320
      OrigRight       =   3960
      OrigBottom      =   2055
      SyncBuddy       =   -1  'True
      BuddyProperty   =   65547
      Enabled         =   -1  'True
   End
   Begin MSComCtl2.UpDown UpDown1 
      Height          =   375
      Left            =   3720
      TabIndex        =   3
      Top             =   960
      Width           =   240
      _ExtentX        =   423
      _ExtentY        =   661
      _Version        =   393216
      BuddyControl    =   "Text1"
      BuddyDispid     =   196613
      OrigLeft        =   3600
      OrigTop         =   840
      OrigRight       =   3840
      OrigBottom      =   1575
      SyncBuddy       =   -1  'True
      BuddyProperty   =   0
      Enabled         =   -1  'True
   End
   Begin VB.Timer Timer1 
      Interval        =   100
      Left            =   360
      Top             =   240
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   3120
      TabIndex        =   2
      Text            =   "4"
      Top             =   1920
      Width           =   615
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   3120
      TabIndex        =   1
      Text            =   "3"
      Top             =   1440
      Width           =   615
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   3120
      TabIndex        =   0
      Text            =   "2"
      Top             =   960
      Width           =   615
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "绿"
      Height          =   180
      Left            =   2880
      TabIndex        =   8
      Top             =   2040
      Width           =   180
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "黄"
      Height          =   180
      Left            =   2880
      TabIndex        =   7
      Top             =   1560
      Width           =   180
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "红"
      Height          =   180
      Left            =   2880
      TabIndex        =   6
      Top             =   1080
      Width           =   180
   End
   Begin VB.Image Image4 
      Height          =   615
      Left            =   1800
      Top             =   1200
      Width           =   615
   End
   Begin VB.Image Image1 
      Height          =   480
      Left            =   2160
      Picture         =   "sy07-07.frx":0000
      Top             =   240
      Width           =   480
   End
   Begin VB.Image Image2 
      Height          =   480
      Left            =   3000
      Picture         =   "sy07-07.frx":0442
      Top             =   240
      Width           =   480
   End
   Begin VB.Image Image3 
      Height          =   480
      Left            =   3720
      Picture         =   "sy07-07.frx":0884
      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()
    Image1.Visible = False
    Image2.Visible = False
    Image3.Visible = False
End Sub

Private Sub Timer1_Timer()
    If i = 0 Then
        Timer1.Interval = Val(Text1.Text) * 1000
        i = (i + 1) Mod 3
        Image4.Picture = Image1.Picture
    ElseIf i = 1 Then
        Timer1.Interval = Val(Text2.Text) * 1000
        i = (i + 1) Mod 3
        Image4.Picture = Image2.Picture
    ElseIf i = 2 Then
        Timer1.Interval = Val(Text3.Text) * 1000
        i = (i + 1) Mod 3
        Image4.Picture = Image3.Picture
    End If
End Sub
