I'm trying to make an event that will load image to next empty picture box
This code is in the picturebox.click event that is loaded with image
int counter = 0;
List<PictureBox> pbox= new List<PictureBox>(); //Holds list of PictureBoxes that will be loaded(currently there are 28)
PictureBox img = ((PictureBox) sender); //Holds the image that i clicked
foreach (Control ctrl in groupBox1.Controls) //Enumerate all controls and add them to the list
{
if (ctrl is PictureBox)
{
pbox.Add((PictureBox) ctrl);
}
}
pbox[counter] = img; //loads the image to the first picturebox in list
pictureBox1.Image = pbox[counter].Image; // Now this should load the image (i need help with this), what should i use instead picturebox1.Image
counter++;

New Topic/Question
Reply



MultiQuote




|