Solved

How to make an ANIMATED Background ???

Posted on 1998-06-13
2
223 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 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