System.Windows.Forms.ControlPaint.DrawGrid Method

Draws a grid of one-pixel dots with the specified spacing, within the specified bounds, on the specified graphics surface, and in the specified color.

Syntax

public static void DrawGrid (System.Drawing.Graphics graphics, System.Drawing.Rectangle area, System.Drawing.Size pixelsBetweenDots, System.Drawing.Color backColor)

Parameters

graphics
The System.Drawing.Graphics to draw on.
area
The System.Drawing.Rectangle that represents the dimensions of the grid.
pixelsBetweenDots
The System.Drawing.Size that specified the height and width between the dots of the grid.
backColor
The System.Drawing.Color of the background behind the grid.

Remarks

The backColor parameter is used to calculate the fill color of the dots so that the grid is always visible against the background.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0