I need to reference an image control and a text box control in an array.
This is what I have:
string[,] arrShowHands = new string [4,3];
arrShowHands[1,1] = txtDealt1.Text;
arrShowHands[1,2] = "imgPlayer1H1";
This works without an array:
imgPlayer1H1.ImageUrl = strImage + arrCardDeck[Convert.ToInt16(txtDealt1.Text)] + strExt;
imgPlayer1H2.ImageUrl = strImage + arrCardDeck[Convert.ToInt16(txtDealt2.Text)] + strExt;
imgPlayer2H1.ImageUrl = strImage etc....
However, I have several image and text box controls and wish to use a loop thru an array instead of having seperate statements.
This is what I would prefer:
for (int intRowCtr = 1; intRowCtr < 4; intRowCtr++)
arrShowHands[intRowCtr,2] .ImageUrl = strImage +
arrCardDeck[Convert.ToInt16( arrShowHands[intRowCtr,1] )] + strExt;
arrShowHands[intRowCtr,2] needs to represent an image control in the statement.
arrShowHands[intRowCtr,1] needs to represent a text box control in the statement.