RickyUser6
Member
- Joined
- Jan 27, 2006
- Messages
- 7
- Programming Experience
- 1-3
Hello there,
I've been searching for a while on how to correctly loop images from a folder.
My program consists of 6 pictureboxes that get populated by images from a folder in my computer.
I have a "Next" button that when clicked, shows the next 6 images.
My problem is, after I hit the "Next" button one more time, it doesn't cycle through the remaining pictures.
Example: I have 14 images in a folder. The program loads, it displays the first 6 images (1-6), I hit the "Next" button, and it displays the next 6 images (7-12). I hit the "Next" button once more, but the remaining images don't show (what's showing in the picturebox at this moment are pictures 7-12).
I was hoping someone could give me a hint on where the problem might be.
Here is part of my code:
Anything fishy that you guys catch from the above code?
Thanks in advance!
I've been searching for a while on how to correctly loop images from a folder.
My program consists of 6 pictureboxes that get populated by images from a folder in my computer.
I have a "Next" button that when clicked, shows the next 6 images.
My problem is, after I hit the "Next" button one more time, it doesn't cycle through the remaining pictures.
Example: I have 14 images in a folder. The program loads, it displays the first 6 images (1-6), I hit the "Next" button, and it displays the next 6 images (7-12). I hit the "Next" button once more, but the remaining images don't show (what's showing in the picturebox at this moment are pictures 7-12).
I was hoping someone could give me a hint on where the problem might be.
Here is part of my code:
VB.NET:
Dim pics() As PictureBox = {Card1, Card2, Card3, Card4, Card5, Card6}
Dim List() As String = Directory.GetFiles("C:\Users\blabla\Desktop\Country", "*.jpg")
For i As Integer = 0 To pics.Count - 1
pics(i).Image = Image.FromFile(List(i + 6))
Next
Anything fishy that you guys catch from the above code?
Thanks in advance!