System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
System.Drawing.Graphics formGraphics;
formGraphics = this.CreateGraphics();
for (int ii = 0; ii != (10); ii++)
{
for (int i = 0; i != (10); i++)
{
formGraphics.FillRectangle(myBrush, new Rectangle(i * 30, ii*30, 20, 20));
}
}
myBrush.Dispose();
formGraphics.Dispose();
I am trying to code minesweeper. I am basically trying to create a set of rectangles that a user will be able to click, but when I am trying to use the code above, all I have is a set of 10x10 rectangles that a user cannot interact with.