Code: Select all
Button[,] square = new Button[10, 10];
for (i = 1; i <= 8; i++)
{
for (j = 1; j <= 8; j++)
{
square[i, j] = new Button();
square[i, j].Size = new Size(70, 70);
square[i, j].Anchor = AnchorStyles.Right;
square[i, j].Location = new Point(12 + (i - 1) * 68, 600 - 68 * (j - 1));
square[i, j].BackgroundImage = empty;
square[i, j].Visible = true;
this.Controls.Add(square[i, j]);
square[i, j].Click += new System.EventHandler(ClickButton);
}
}