Here is the code I have:
DataRow SavedGameRow = tbl.Rows[0];
for (x = 1; x < 10; x++)
{
switch (SavedGameRow[x])
{
case "X": pictureBox1.Image = "playerOne.Img"; break;
case "O": pictureBox1.Image = "playerTwo.Img"; break;
case "E": //Some code
break;
}
}
Is there a way that where the '1' is in the pictureBox1.Image = blahblah that I can use the X value in my loop without putting the picture boxes into an array and doing it like pictureBox[x] ?
Thanks for your help!
DataRow SavedGameRow = tbl.Rows[0];
for (x = 1; x < 10; x++)
{
switch (SavedGameRow[x])
{
case "X": pictureBox1.Image = "playerOne.Img"; break;
case "O": pictureBox1.Image = "playerTwo.Img"; break;
case "E": //Some code
break;
}
}
Is there a way that where the '1' is in the pictureBox1.Image = blahblah that I can use the X value in my loop without putting the picture boxes into an array and doing it like pictureBox[x] ?
Thanks for your help!