How do you access pictureboxes as arrays

Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Oct 2008
Posts: 3
Reputation: eberger2001 is an unknown quantity at this point 
Solved Threads: 0
eberger2001 eberger2001 is offline Offline
Newbie Poster

How do you access pictureboxes as arrays

 
0
  #1
Oct 14th, 2008
I have a whole bunch of pictureboxes on my form, they have the name picturebox1, picturebox2...picturebox36, and I was wondering if there was a way I could access them using an array. Would I have to create them using a picturebox array and manually type in their locations and such, because I would not like to do that if possible.
Thanks,
Eric Berger
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 3
Reputation: eberger2001 is an unknown quantity at this point 
Solved Threads: 0
eberger2001 eberger2001 is offline Offline
Newbie Poster

Re: How do you access pictureboxes as arrays

 
0
  #2
Oct 19th, 2008
I found out how to do this:
  1. Public MedalPicBoxes(35) As PictureBox
  2. Sub InitializePics()
  3. MedalPicBoxes(0) = PictureBox1
  4. MedalPicBoxes(1) = PictureBox2
  5. ...........
  6. MedalPicBoxes(34) = PictureBox35
  7. MedalPicBoxes(35) = PictureBox36
  8. End Sub
Last edited by eberger2001; Oct 19th, 2008 at 4:53 am.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 3
Reputation: eberger2001 is an unknown quantity at this point 
Solved Threads: 0
eberger2001 eberger2001 is offline Offline
Newbie Poster

Re: How do you access pictureboxes as arrays

 
0
  #3
Oct 19th, 2008
I found out how to do this:
  1. Public MedalPicBoxes(35) As PictureBox
  2. Sub InitializePics()
  3. MedalPicBoxes(0) = PictureBox1
  4. MedalPicBoxes(1) = PictureBox2
  5. ...........
  6. MedalPicBoxes(34) = PictureBox35
  7. MedalPicBoxes(35) = PictureBox36
  8. End Sub
Last edited by eberger2001; Oct 19th, 2008 at 4:53 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC