Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    picture boxes visual basic 2008.....

    hey everyone!!!
    well i am programming in vb 2008 and i hav a little problemo.....
    I hav added 8 picture boxes in my application and i wana know if i can go through all those 8 picture boxes in a "FOR LOOP" ...something lyk this....

    Code:
    for i=0 to 7 step 1
    picturebox(i).image=image.fromfile(path)
    now the problem is that i am not allowed to use "picturebox(i)" .... is there a way to go through all the picture boxes in a for loop???

    any help wud b appriciated......

  • #2
    Regular Coder
    Join Date
    Feb 2010
    Posts
    104
    Thanks
    5
    Thanked 3 Times in 3 Posts
    This what you need?

    Code:
    For i = 0 To 7
    picturebox(i).image=image.fromfile(path)
    Next i
    P.S. Don't worry about the step, you don't need it for increments of 1 on each loop


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •