Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleAnimate a series of images stored in a PictureClip control and display blocking and non-blocking message boxes
DescriptionThis example shows how to animate a series of images stored in a PictureClip control and display blocking and non-blocking message boxes in Visual Basic 6.
KeywordsPictureClip, animate, animation, Timer, blobk, MessageBox, MsgBox
CategoriesControls, Multimedia
 
Thanks to Dipak Auddy.

When you click the Start button, the code enables the tmrAm Timer control. That control's event handler displays the next image in the PictureClip control.

 
Private Sub tmrAm_Timer()

    CI = CI + 1
    If CI = 18 Then
        CI = 0
    End If
    picAm.Picture = PC.GraphicCell(CI)

End Sub
 
When you click the "Show MsgBox (Normal)" button, the program displays a message by using MsgBox. That blocks the animation until you dismiss the message box.

When you click the "Show MsgBox (API)" button, the program uses the following code to display a message box. The call to the MessageBox SPI function does not stop the animation from running.

 
Private Sub cmdShowMsgBoxAPI_Click()

    On Error Resume Next
    Debug.Assert "TESTDEBUG"
    '<:-) :SUGGESTION: Code used to generate data only for
    ' Debug should be removed from final code.
    If Err.Number = 0 Then
        ' Runtime variant
        MsgBox "THIS TEST IS ONLY VALID IN VB6 IDE.", _
            vbExclamation, "Message From PicClip"
    Else 'NOT ERR.NUMBER...
        ' Debug variant
        MessageBox Me.hwnd, "Huh, You Can't Stop Me!", _
            "Message From PicClip", vbInformation
    End If
    On Error GoTo 0

End Sub
 
 
Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated