Link to home
Start Free TrialLog in
Avatar of RobertoFreemano
RobertoFreemanoFlag for United Kingdom of Great Britain and Northern Ireland

asked on

For Loop on imageList (picturebox) - vb.net

Hi Experts,

I have a winform with a Button, picturebox and imagelist. The imagelist only has 3 images embedded.

I simply want to click button1 and it shows image0, then if clicked again, image1, then if clicked again.. image 2... then loop if clicked.
 Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim i As Integer
        For i = 0 To 2
            PictureBox1.Image = ImageList1.Images(i)
            i = i + 1
        Next
    End Sub

Open in new window

My code only shows image0...

Help!
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RobertoFreemano

ASKER

Thanks Mike ;)