954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Display a slideshow of pictures on a vb 6

Is there any way possible to display a slideshow of pictures on a vb 6 form?

What steps are required?

Thankyou

Jollyyy100
Junior Poster in Training
84 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

You need to have a few pictures, put them in a loop load under a timer event, and you will have a slide show.:)

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

I'm just a beginner, i don't know much about the loop load part.
Is there any other way possible?
Thank you

Jollyyy100
Junior Poster in Training
84 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

I'll post some solutions tomorrow morning (another 11 hours my time) and we will see where this is going. You do however need to read up on this kind of coding, it is more advance than beginner stuff, sorry.;)

We can not keep on giving you the full solution to all your problems, post some code here where you have at least tried to make it work, and I will gladly give help.:)

Talk tomorrow.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Ok no problem.
Thank you

Jollyyy100
Junior Poster in Training
84 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

The process is pretty straight forward if you know a few key controls. One is a picturebox/image control which will be used to display the image. Another is the timer control which will be used to execute the loading of the next picture after a specified number of "ticks" and the last bit is the LoadPicture() function which will be used to load a picture file into the picturebox control.

Essentially how it works is that you add a picturebox or image control as well as a timer control to your project. Then double click the timer control to open up the timer's default tick event, in there you will use the LoadPicture function to load a picture from your computer (specifying its path) into the picturebox/image control through its picture/image property. After so many milliseconds on the timer, it will execute, load a picture into the picturebox.

The trick is getting a list of pictures you want shown and incrementing through them. The concept is not hard, but it will take a bit of careful planning to make sure that you get the right files and in the order you want to show them.

There is another control in your toolbox called an "imagelist" control. That will allow you to store all your pictures. Using that, you can feed images to your picturebox. The parts you will need are...

1) Picturebox to show the current image
2) Imagelist control on your form to hold all your pictures and to fetch the next "slide" from.
3) Timer control will allow you to pull the next picture at a given interval (change slides after X seconds)

The timer control calls an event every X number of milliseconds. This event is called the "tick" event. In that event you will read your next picture out of the imagelist control and then load it into your picturebox control. When you reach the end of your pictures in the imagelist control, you can reset your picture counter to 0 and start over pulling images out of the imagelist control.

So look at those three controls (and their properties like the "Picture","ListImages collection" and "interval"), the tick event (where most of your code will go) and you will have a great start for your project. Below is a link to a page showing you how to pull images out of the Imagelist using the ListImages collection.

This is the basic planning behind it...;)

a Loop will be something like -

Dim picImage as ListImage
For Each picImage in ImageListImageList1.ListImages
Picture1.Picture = picImage.Picture
Next


If you knew the image you wanted to move to a PictureBox, you could just code this:

Picture1.Picture = ImageList1.ListImages(3).Picture

'or this:

Picture1.Picture = ImageList1.ListImages("Smiley").Picture

Put this code under a timer with its interval set to say 1000 (1 second). It will now load every picture in order as in your imagelsit control.:)

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Hey, thank you so very much...
Your a guru...

Thank you

Jollyyy100
Junior Poster in Training
84 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

:) It was a pleasure. Happy coding.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: