Solved

How to make an ANIMATED Background ???

Posted on 1998-06-13
2
198 Views
Last Modified: 2010-05-03
OK, I now know of two simple ways to add background textures to a VB5 Form.
In other words, I know how to add a textured background by putting pictures tiles on the form.

Now the hard question:  How do I add an ANIMATED background to a VB5 form ???
I don't care to use any Draw techniques. I want realistic pictures to be cycled to make
an animated background.

My forms are small, about 1/3 size of screen. I had thought of the following:
Add 6 pcitures, one on top of the next. Then just cycle through these by setting the
Visible attribute on each picture. I think most buttons ect... will stay on top. I haven't tried this.
Any other ideas???
0
Comment
Question by:jgore
2 Comments
 
LVL 5

Accepted Solution

by:
bin_huwairib earned 220 total points
ID: 1463238
jgore,

Use ImageList control in Microsoft Windows Common Controls (COMCTL32.OCX) to store your images and then assign the indexed image with your Picture Box at a specific time, in this case you will only use one Picture Box control instead of having Picture box control for each picture.

Example
=======
1- Add form1 to project1.
2- Add picture1, imagelist1 and timer1 to form1.
3- Paste the following code in form1:

Const ImageCount = 3

Dim ImageIndex As Integer

Private Sub Form_Load()
 ImageIndex = 0
 ImageList1.ListImages.Add , , LoadPicture("c:\windows\Bubbles.bmp")
 ImageList1.ListImages.Add , , LoadPicture("c:\windows\Forest.bmp")
 ImageList1.ListImages.Add , , LoadPicture("c:\windows\Weave2.bmp")
 Timer1.Interval = 500
End Sub

Private Sub Timer1_Timer()
 ImageIndex = ImageIndex + 1
 If ImageIndex > ImageCount Then ImageIndex = 1
 Picture1.Picture = ImageList1.ListImages(ImageIndex).Picture
End Sub


Best regards
Bin Huwairib
0
 

Author Comment

by:jgore
ID: 1463239
Thanks, thats much easier than they way I did it.
I just used 8 images and cycled their Visibilty attribute.
It worked, but your way looks much better. C-ya........
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA error replacing data 6 37
Reading the Contents of a Directory In Access VBA 5 58
How does CurrentUser work? 10 31
Help me. 3 46
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now