VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form Form1 
   Caption         =   "骏马奔腾"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Interval        =   50
      Left            =   2970
      Top             =   1440
   End
   Begin ComctlLib.ImageList ImageList1 
      Left            =   2085
      Top             =   945
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   48
      ImageHeight     =   48
      MaskColor       =   12632256
      _Version        =   327682
      BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
         NumListImages   =   24
         BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":0000
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":031A
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":0634
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":094E
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":0C68
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":0F82
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":129C
            Key             =   ""
         EndProperty
         BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":15B6
            Key             =   ""
         EndProperty
         BeginProperty ListImage9 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":18D0
            Key             =   ""
         EndProperty
         BeginProperty ListImage10 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":1BEA
            Key             =   ""
         EndProperty
         BeginProperty ListImage11 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":1F04
            Key             =   ""
         EndProperty
         BeginProperty ListImage12 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":221E
            Key             =   ""
         EndProperty
         BeginProperty ListImage13 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":2538
            Key             =   ""
         EndProperty
         BeginProperty ListImage14 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":2852
            Key             =   ""
         EndProperty
         BeginProperty ListImage15 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":2B6C
            Key             =   ""
         EndProperty
         BeginProperty ListImage16 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":2E86
            Key             =   ""
         EndProperty
         BeginProperty ListImage17 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":31A0
            Key             =   ""
         EndProperty
         BeginProperty ListImage18 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":34BA
            Key             =   ""
         EndProperty
         BeginProperty ListImage19 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":37D4
            Key             =   ""
         EndProperty
         BeginProperty ListImage20 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":3AEE
            Key             =   ""
         EndProperty
         BeginProperty ListImage21 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":3E08
            Key             =   ""
         EndProperty
         BeginProperty ListImage22 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":4122
            Key             =   ""
         EndProperty
         BeginProperty ListImage23 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":443C
            Key             =   ""
         EndProperty
         BeginProperty ListImage24 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":4756
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.Image imgHorse 
      Enabled         =   0   'False
      Height          =   720
      Left            =   1995
      Top             =   2280
      Width           =   750
   End
   Begin VB.Image imgBack 
      Enabled         =   0   'False
      Height          =   2550
      Left            =   -405
      Picture         =   "Form1.frx":4A70
      Stretch         =   -1  'True
      Top             =   45
      Width           =   5760
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False



Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
        Select Case KeyCode                         '判断哪一个键被按下
        Case vbKeyLeft                              '当向左键被按下时
            If imgHorse.Left > 0 Then
                imgHorse.Left = imgHorse.Left - 50  '骏马图像向左移
            End If
        Case vbKeyRight                             '当向右键被按下时
            If imgHorse.Left < Form1.Width - imgHorse.Width Then
                imgHorse.Left = imgHorse.Left + 50  '骏马图像向右移
            End If
       Case vbKeyUp                                 '当向上键被按下时
            If imgHorse.Top > 0 Then
                imgHorse.Top = imgHorse.Top - 50    '骏马图像向上移
            End If
        Case vbKeyDown                              '当向下键被按下时
              If imgHorse.Top < Form1.Height - imgHorse.Height Then
                imgHorse.Top = imgHorse.Top + 50    '骏马图像向下移

            End If
    End Select

End Sub

Private Sub Form_Load()
    '初始化背景的位置和大小
    imgBack.Left = 0
    imgBack.Top = 0
    imgBack.Width = Form1.Width
    imgBack.Height = Form1.Height
    '初始化马的位置
    imgHorse.Top = Form1.Height / 2
    imgHorse.Left = Form1.Width / 2
End Sub

Private Sub Form_Resize()
    '当窗体大小改变时，重设置背景大小、位置
    imgBack.Left = 0
    imgBack.Top = 0
    imgBack.Width = Form1.Width
    imgBack.Height = Form1.Height
End Sub

Private Sub Timer1_Timer()
    Static i As Integer     '利用静态变量来存储图像的索引号，其初始值为默认值0
    If i < 24 Then          '确定图像列表的索引值不超出范围
        i = i + 1
    Else
       i = 1
    End If
  '将图像列表框imageList1的第i张图片赋给图像控件
    Set imgHorse.Picture = ImageList1.ListImages(i).ExtractIcon
End Sub

