using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
int x, y = 10, w = 50, h = 50;
Pen pen = new Pen(Color.Black, 2);
for (int i = 1; i <= 8; i++)
{
x = 10;
for (int j = 1; j <= 8; j++)
{
Graphics g = this.CreateGraphics();
g.DrawRectangle(pen, new Rectangle(x, y, w, h));
x += 50;
g.Dispose();
}
y += 50;
}
pen.Dispose();
}
}
}