adressing a "random" picturebox

D

dawn

Hi,

I'm writing an app that has two rows of 6 pictureboxes.

1 2 3 4 5 6

7 8 9 10 11 12

When i click on a picturebox in one row.....for example 7....i want the
picture in it to move to the first free picturebox in the other row. So if 1
and 2 are occupied I want it to move to 3.
Is there any way i can do this???


Thanks,

Bart.
 
F

Fergus Cooney

Hi Bart,

Put the bottom row of PictureBoxes into an array. Then, when a top row PictureBox is
clicked, run through the array to find the first one which doesn't have its Image property
set yet.

Regards,
Fergus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top