VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   5820
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5820
   LinkTopic       =   "Form1"
   ScaleHeight     =   5820
   ScaleWidth      =   5820
   StartUpPosition =   3  '系統預設值
   Begin VB.Timer Timer2 
      Interval        =   500
      Left            =   5040
      Top             =   4200
   End
   Begin VB.Timer Timer1 
      Interval        =   500
      Left            =   5040
      Top             =   3120
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   975
      Left            =   4200
      TabIndex        =   1
      Top             =   1800
      Width           =   1335
   End
   Begin VB.TextBox Text1 
      Height          =   2655
      Left            =   120
      MultiLine       =   -1  'True
      ScrollBars      =   2  '垂直捲軸
      TabIndex        =   0
      Text            =   "Form1.frx":0000
      Top             =   120
      Width           =   3975
   End
   Begin VB.Label Label2 
      Appearance      =   0  '平面
      BackColor       =   &H80000005&
      BorderStyle     =   1  '單線固定
      ForeColor       =   &H80000008&
      Height          =   615
      Index           =   4
      Left            =   960
      TabIndex        =   11
      Top             =   4080
      Width           =   615
   End
   Begin VB.Label Label2 
      Appearance      =   0  '平面
      BackColor       =   &H80000005&
      BorderStyle     =   1  '單線固定
      ForeColor       =   &H80000008&
      Height          =   615
      Index           =   3
      Left            =   1800
      TabIndex        =   10
      Top             =   4080
      Width           =   615
   End
   Begin VB.Label Label2 
      Appearance      =   0  '平面
      BackColor       =   &H80000005&
      BorderStyle     =   1  '單線固定
      ForeColor       =   &H80000008&
      Height          =   615
      Index           =   2
      Left            =   2640
      TabIndex        =   9
      Top             =   4080
      Width           =   615
   End
   Begin VB.Label Label2 
      Appearance      =   0  '平面
      BackColor       =   &H80000005&
      BorderStyle     =   1  '單線固定
      ForeColor       =   &H80000008&
      Height          =   615
      Index           =   1
      Left            =   3480
      TabIndex        =   8
      Top             =   4080
      Width           =   615
   End
   Begin VB.Label Label2 
      Appearance      =   0  '平面
      BackColor       =   &H80000005&
      BorderStyle     =   1  '單線固定
      ForeColor       =   &H80000008&
      Height          =   615
      Index           =   0
      Left            =   120
      TabIndex        =   7
      Top             =   4080
      Width           =   615
   End
   Begin VB.Line Line1 
      X1              =   120
      X2              =   5520
      Y1              =   3840
      Y2              =   3840
   End
   Begin VB.Label Label1 
      Appearance      =   0  '平面
      BackColor       =   &H80000005&
      BorderStyle     =   1  '單線固定
      ForeColor       =   &H80000008&
      Height          =   615
      Index           =   4
      Left            =   960
      TabIndex        =   6
      Top             =   3000
      Width           =   615
   End
   Begin VB.Label Label1 
      Appearance      =   0  '平面
      BackColor       =   &H80000005&
      BorderStyle     =   1  '單線固定
      ForeColor       =   &H80000008&
      Height          =   615
      Index           =   3
      Left            =   1800
      TabIndex        =   5
      Top             =   3000
      Width           =   615
   End
   Begin VB.Label Label1 
      Appearance      =   0  '平面
      BackColor       =   &H80000005&
      BorderStyle     =   1  '單線固定
      ForeColor       =   &H80000008&
      Height          =   615
      Index           =   2
      Left            =   2640
      TabIndex        =   4
      Top             =   3000
      Width           =   615
   End
   Begin VB.Label Label1 
      Appearance      =   0  '平面
      BackColor       =   &H80000005&
      BorderStyle     =   1  '單線固定
      ForeColor       =   &H80000008&
      Height          =   615
      Index           =   1
      Left            =   3480
      TabIndex        =   3
      Top             =   3000
      Width           =   615
   End
   Begin VB.Label Label1 
      Appearance      =   0  '平面
      BackColor       =   &H80000005&
      BorderStyle     =   1  '單線固定
      ForeColor       =   &H80000008&
      Height          =   615
      Index           =   0
      Left            =   120
      TabIndex        =   2
      Top             =   3000
      Width           =   615
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim t   '公共變數
Private Sub Command1_Click()
    'hideselection
    'scrollbars
    b = ""     '領頭
    For i = 1 To 9
        For j = 1 To 9
            a = i & "*" & j & "=" & i * j
            b = b & a & vbCrLf '換行符號
        Next
    Next
    Text1.Text = b
    
End Sub

Private Sub Timer1_Timer()
    '所有格子刷成白色
    For i = 0 To 4
        Label1(i).BackColor = RGB(255, 255, 255)
    Next
    '亂數取格子
    r = Int(Rnd * 5) '0~4
    Label1(r).BackColor = RGB(255, 0, 0)
    
    'If Label1(r).BackColor = RGB(255, 0, 0) Then Timer1.Enabled = False

End Sub

Private Sub Timer2_Timer()
    '所有格子刷成白色
    For i = 0 To 4
        Label2(i).BackColor = RGB(255, 255, 255)
    Next
    '依序由右向左取一格子刷成紅色
    t = t + 1
    If t = 5 Then
        t = 0
    End If
    Label2(t).BackColor = RGB(255, 0, 0)

    
    
End Sub
