|
-
Jun 16th, 2010, 02:16 PM
#1
Thread Starter
New Member
[RESOLVED] 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......
-
Jun 16th, 2010, 02:48 PM
#2
Fanatic Member
Re: picture boxes visual basic 2008.....
This is a .Net question posted in the vb6 forum - i guess the mods will move this thread soon.
I've never done this but on the .net forum we discussed things like this just a couple of days ago. Search for "Control Arrays".
It appears that something like this may work. Create your picture boxes on your form picturebox1, picturbox2, picturebox3 etc
Then in your loop you can refer to them like this:-
for i = 1 to 7
me.controls("PictureBox" & i).image = someimage
next i
As I said, I've never done that before so the syntax may not be accurate but it may put you on the right track
-
Jun 16th, 2010, 02:59 PM
#3
Thread Starter
New Member
Re: picture boxes visual basic 2008.....
thx for ur reply.....
i am sory for posting this in wrong section....
-
Jun 16th, 2010, 03:05 PM
#4
Re: picture boxes visual basic 2008.....
Thread moved from 'VB6 and Earlier' forum to 'VB.Net' (VB2002 and later) forum
-
Jun 16th, 2010, 05:04 PM
#5
Thread Starter
New Member
Re: picture boxes visual basic 2008.....
ok problemo solved...... this topic can be closed.....
-
Jun 17th, 2010, 04:38 AM
#6
Re: picture boxes visual basic 2008.....
In that case please mark the thread as Resolved, via the "Thread tools" menu just above the first post in this thread, then "Mark thread resolved". (like various other features of this site, you need JavaScript enabled in your browser for this to work).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|