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
 
 
 
 
 
TitleUse Image and ImageList controls to animate a series of images
DescriptionThis example shows how to use Image and ImageList controls to animate a series of images in Visual Basic 6.
KeywordsImage, ImageList, animate
CategoriesGraphics, Controls
 
The images are stored in an ImageList control. When the program starts, it saves the number of images.

When the Timer fires, the program displays the next image in the Image control.

 
Private m_Index As Integer
Private m_NumImages As Integer

Private Sub Form_Load()
    m_NumImages = ImageList1.ListImages.Count
    m_Index = 0
End Sub

Private Sub Timer1_Timer()
    ' Image indexes are between 1 and m_NumImages.
    m_Index = ((m_Index + 1) Mod m_NumImages) + 1
    Image1.Picture = ImageList1.ListImages(m_Index).Picture
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated