Solved

How to make an ANIMATED Background ???

Posted on 1998-06-13
2
213 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

730 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