Hello, guys, I encountered a big problem. There is a genereted matrix of buttons:
private void Single_Load(object sender, EventArgs e)
{
//code here
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
//a lot of working code here
b[i, j].Click += new System.EventHandler(ClickButton);
}
}
}
What can I do when one of those buttons is pressed (i have the method ClickButton
) to know what i and j has he?
I want to make smoething like this
ClickButton()
{
if (x%2==0)
v[i, j] = x; //i and j should be form the matrix of buttons
}