Hello,
I'm not sure if the title makes any sense, but this is what I'm trying to do. I have multiple buttons and it's connected to this single event handler. The ID for each button is btnXX, XX being the row and column.
protected void btn_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
int clicked_row = int.Parse(btn.ID.Substring(3, 1));
int clicked_col = int.Parse(btn.ID.Substring(4, 1));
}
As you can see, it takes the row and column number into an int value. When a button is clicked, the buttons above and right of it needs to change colors. I put the int value into a loop so it would know which buttons to change colors.
What I don't understand is how would I put those integer values back into the button ID names so it knows which button to change colors? So if I clicked on btn24, clicked_row would be read as 2 and once it goes through the loop, it would now be 1 and should tell the program btn14 needs to be changed.
Thanks.