0

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.

2
Contributors
1
Reply
10
Views
3 Years
Discussion Span
Last Post by Fenrir()
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.