Hello,
I have some 5 picture boxes, and stored the images into imagelist. Now I can able to load 5 picture boxes with first five images from imagelist. I have two buttons previous and next.
I got stuck with this, please help
On click of next button, it should hide picture from picturebox1, and move all the images, finally the 6th image from imagelist should be loaded into picturebox5.

And vice versa on previous button event.

Thanks.

Well this might be a bad example but you can accomplish this by doing the following.

Add a counter for each picturebox
In the form load set the PictureBox.Image property to Imagelist.Images[Counter] for each picturebox
In the Previous and Next buttons Increment and Decrement the Counters.
Add a general method that accepts the Picturebox and the Counter
In the method add a try block and try to set the picturebox image to the imagelist.Picture[Counter]
in the catch block add Picturebox.Image = null; and Picturebox.Refresh();

First way i could think of off the top of my head.

Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.