Solved

How to make an ANIMATED Background ???

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…

743 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

10 Experts available now in Live!

Get 1:1 Help Now