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 loadedCenter
: Sets whether the animation is centered in the controlFileName
: Sets or gets the path of the AVI fileRepeat
: Sets whether the animation plays in a loopTransparent
: Sets whether the animation uses a transparent backgroundBackColor
: Sets the background colorBackStyle
: Sets the background style (transparent or opaque)
Methods
Main Methods
Open(FileName As String)
: Opens the specified AVI filePlay()
: Starts playing the animationStop()
: Stops playing the animationClose()
: Closes the currently open animation fileSeek(Frame As Long)
: Jumps to the specified frame
Events
Start()
: Triggered when the animation starts playingStop()
: 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