VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00FF00FF&
   Caption         =   "简单动画例"
   ClientHeight    =   3915
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5595
   LinkTopic       =   "Form1"
   Picture         =   "sy01-01.frx":0000
   ScaleHeight     =   3915
   ScaleWidth      =   5595
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command1 
      Height          =   495
      Left            =   3600
      Picture         =   "sy01-01.frx":57E82
      Style           =   1  'Graphical
      TabIndex        =   1
      ToolTipText     =   "自动"
      Top             =   3360
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Height          =   495
      Left            =   4680
      Picture         =   "sy01-01.frx":585C4
      Style           =   1  'Graphical
      TabIndex        =   0
      ToolTipText     =   "手动"
      Top             =   3360
      Width           =   855
   End
   Begin VB.Timer Timer1 
      Interval        =   100
      Left            =   2160
      Top             =   2520
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "欢迎使用"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   2100
      Left            =   4800
      TabIndex        =   2
      Top             =   720
      Width           =   660
      WordWrap        =   -1  'True
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim step1 As Integer
Private Sub Form_Load()
  step1 = 1
  Timer1.Interval = 0
End Sub

Private Sub Command2_Click()   '手动
   Timer1.Interval = 0
    Call MyMove
End Sub

Private Sub Command1_Click()  '自动
  Timer1.Interval = 200
End Sub
Private Sub Timer1_Timer()
    Static Flag As Boolean
    If Flag Then Label1.ForeColor = &HFFFFFF Else Label1.ForeColor = &H0&
    Flag = Not Flag
    Call MyMove
End Sub

Public Sub MyMove()
  Label1.Move Label1.Left + 50 * step1
   If Label1.Left > Form1.Width Then
      step1 = -1
     ElseIf Label1.Left < 0 Then
       step1 = 1
   End If
End Sub
