vbAccelerator - Contents of code file: frmTestAnim.frm

VERSION 5.00
Begin VB.Form frmTestAnim 
   Caption         =   "Test Animation Control"
   ClientHeight    =   5085
   ClientLeft      =   3180
   ClientTop       =   2640
   ClientWidth     =   6630
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmTestAnim.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   5085
   ScaleWidth      =   6630
   Begin VB.CommandButton cmdLongOp 
      Caption         =   "&Perform Long Operation"
      Height          =   615
      Left            =   120
      TabIndex        =   6
      Top             =   4200
      Width           =   1335
   End
   Begin VB.CommandButton cmdRes 
      Caption         =   "&Stop"
      Height          =   435
      Left            =   5220
      TabIndex        =   5
      Top             =   2520
      Width           =   1215
   End
   Begin VB.CommandButton cmdFile 
      Caption         =   "&Stop"
      Height          =   435
      Left            =   5160
      TabIndex        =   4
      Top             =   360
      Width           =   1215
   End
   Begin VB.PictureBox picResAnim 
      BackColor       =   &H80000005&
      Height          =   1335
      Left            =   120
      ScaleHeight     =   1275
      ScaleWidth      =   4935
      TabIndex        =   3
      Top             =   2520
      Width           =   4995
   End
   Begin VB.PictureBox picFileAnim 
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1215
      Left            =   120
      ScaleHeight     =   1215
      ScaleWidth      =   4875
      TabIndex        =   0
      ToolTipText     =   "Downloading"
      Top             =   420
      Width           =   4875
   End
   Begin VB.Label lblResourceAnim 
      Caption         =   "Animation Loaded from Resource, centred:"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   2160
      Width           =   4455
   End
   Begin VB.Label lblFileAnimation 
      Caption         =   "Animation Loaded from File, positioned:"
      Height          =   255
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   4455
   End
End
Attribute VB_Name = "frmTestAnim"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private m_cAnimFile As New cAnimControl
Private m_cAnimRes As New cAnimControl

Private Sub cmdLongOp_Click()
   
   Screen.MousePointer = vbHourglass
   cmdLongOp.Enabled = False
   
   Dim f As Single
   f = Timer
   Do While (Timer - f < 2.5)
      '
   Loop
   
   cmdLongOp.Enabled = True
   Screen.MousePointer = vbDefault
   
End Sub

Private Sub cmdRes_Click()
   If (cmdRes.Caption = "&Stop") Then
      m_cAnimRes.StopPlay
      cmdRes.Caption = "&Start"
   Else
      m_cAnimRes.StartPlay
      cmdRes.Caption = "&Stop"
   End If
End Sub

Private Sub cmdFile_Click()
   If (cmdFile.Caption = "&Stop") Then
      m_cAnimFile.StopPlay
      cmdFile.Caption = "&Start"
   Else
      m_cAnimFile.StartPlay
      cmdFile.Caption = "&Stop"
   End If
End Sub

Private Sub Form_Load()
   
   m_cAnimFile.AutoPlay = True
   m_cAnimFile.Filename = App.Path & "\download.avi"
   m_cAnimFile.Transparent = True
   Set m_cAnimFile.Owner = picFileAnim
   picFileAnim.Move picFileAnim.left, picFileAnim.top, m_cAnimFile.Width *
    Screen.TwipsPerPixelX, m_cAnimFile.Height * Screen.TwipsPerPixelY
   
   m_cAnimRes.AutoPlay = True
   m_cAnimRes.Centre = True
   m_cAnimRes.Transparent = True
   m_cAnimRes.ResourceFileName = App.Path & "\TestAnim.exe"
   m_cAnimRes.ResourceId = 101
   Set m_cAnimRes.Owner = picResAnim
      
End Sub

Private Sub picFileAnim_Click()
   MsgBox "Clicked File Animation", vbInformation
End Sub