سلام من کد شطرنجي کردن با خطوط افقي و عمودي رو نوشتم که در زير ملاحظه ميکنيد :
int NumWidth = 0, NumHeight = 0,CountHor=0,CountVer=0;
int SetLine = 0;
NumHeight = pictureBox1.Size.Height;
NumWidth = pictureBox1.Size.Width;
CountHor = NumHeight / 20;
CountVer = NumWidth / 20;
Graphics graphic = pictureBox1.CreateGraphics();
Pen aPen = new Pen(Brushes.Black, 2);
for (int i = 0; i <= CountHor + 1; i++)
{
graphic.DrawLine(aPen, SetLine, 0, SetLine, NumHeight);
SetLine = SetLine + 20;
}
SetLine = 0;
for (int i = 0; i <= CountVer + 1; i++)
{
graphic.DrawLine(aPen, 0, SetLine, NumWidth, SetLine);
SetLine = SetLine + 20;
}