public void Picture_ArraySetEvents(PictureBox[,] Picture_Array)
{
byte row, col;
for (row = 0; row < Picture_Array.GetLength(0); row++)
{
for (col = 0; col < Picture_Array.GetLength(1); col++)
{
Picture_Array[row, col].Click += new EventHandle(this.Picture_ArrayClicked);
}
}
}А далее
private void Picture_ArrayClicked(object sender, EventArgs e)
{
int row = (int)(((PictureBox)sender).Tag) / size_board;
int col = (int)(((PictureBox)sender).Tag) % size_board;
Picture_Array[row, col].BorderStyle = BorderStyle.Fixed3D;
}Комп всё прокомпилировал ео при работе выдал ошибку здесь:
int row = (int)(((PictureBox)sender).Tag) / size_board;Написал:
Цитата
Object reference not set to an instance of an object
Что делать!