Skip to content

Animation Control (VBCCRAnimation)

The VBCCRAnimation control provides functionality for displaying AVI video clips or animations in VB6 applications. This control is particularly suitable for displaying simple animation effects such as loading indicators or progress animations.

Properties

Key Properties

  • AutoPlay: Sets whether to automatically play the animation when loaded
  • Center: Sets whether the animation is centered in the control
  • FileName: Sets or gets the path of the AVI file
  • Repeat: Sets whether the animation plays in a loop
  • Transparent: Sets whether the animation uses a transparent background
  • BackColor: Sets the background color
  • BackStyle: Sets the background style (transparent or opaque)

Methods

Main Methods

  • Open(FileName As String): Opens the specified AVI file
  • Play(): Starts playing the animation
  • Stop(): Stops playing the animation
  • Close(): Closes the currently open animation file
  • Seek(Frame As Long): Jumps to the specified frame

Events

  • Start(): Triggered when the animation starts playing
  • Stop(): Triggered when the animation stops playing

Code Examples

Basic Usage

vb
Private Sub Form_Load()
    With Animation1
        .AutoPlay = True
        .Center = True
        .Open App.Path & "\loading.avi"
    End With
End Sub

Controlling Animation Playback

vb
Private Sub PlayAnimation()
    With Animation1
        .FileName = App.Path & "\process.avi"
        .Repeat = True
        .Play
    End With
End Sub

Private Sub StopAnimation()
    Animation1.Stop
End Sub

As a Loading Indicator

vb
Private Sub ShowLoadingAnimation()
    ' Show loading animation
    With Animation1
        .Visible = True
        .Open App.Path & "\loading.avi"
        .Center = True
        .Play
    End With
End Sub

Private Sub HideLoadingAnimation()
    With Animation1
        .Stop
        .Close
        .Visible = False
    End With
End Sub

Common Use Cases

Progress Indicator

vb
Private Sub ShowProgress()
    ' Set up progress animation
    With AnimProgress
        .Visible = True
        .Open App.Path & "\progress.avi"
        .Repeat = True
        .Center = True
        .Play
    End With
    
    ' Perform time-consuming operation
    ProcessData

VB6 and LOGO copyright of Microsoft Corporation