Пример рисования на форме в c#

code: #csharp
using (Graphics gfx = CreateGraphics())
{
    const int offset = 20;
    const int cellSize = 40;
    const int cellsCount = 8;
 
    for (int i = 0; i <= cellsCount; i++)
    {
        gfx.DrawLine(
            Pens.Black,
            new Point(offset, offset + i * cellSize),
            new Point(offset + cellSize * cellsCount, offset + i * cellSize));
 
        gfx.DrawLine(
            Pens.Black,
            new Point(offset + i * cellSize, offset),
            new Point(offset + i * cellSize, offset + cellSize * cellsCount));
    }
}

автор: NightmareZ

Поделиться:

Похожие статьи: