0

Hello!
I have a Picturebox array and a Card object array which has images inside.
I wanted to do a for loop to change the Picturebox images when clicked.
But when using my for-loop, it returns index out of bounds, even when the arrays are identical in size.

for (int i = 0; i < picturebox.Length; i++) 
{
	picturebox[i].Click += delegate(object s, EventArgs e2)
	{
		picturebox[i].Image = CardArray[i].Front;
	};
}
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Momerath
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.