棋盘代码:
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Point pt0 = new Point(100, 100);
int width = 20;
var g = pictureBox1.CreateGraphics();
g.Clear(Color.White);
var pen = new Pen(Color.Blue);
g.DrawRectangle(pen, pt0.X, pt0.Y, width * 18, width * 18);
for (int line = 0; line < 18; line++)
{
int i = 0;
for (i = 0; i < 18; i++)
{
g.DrawRectangle(pen, i * 1 * width + pt0.X, 1 * line * width + pt0.Y, width