The ControlPaint class does not exist in the CF. Your best bet is to draw
a
sample of the grid onto a Bitmap and then use a TextureBrush to splash
this
image over and over again to get the grid look. You can add the following
method to your form class definition and then tweak it as you see fit.
protected override void OnPaintBackground(PaintEventArgs e)
{
using (Bitmap sample = new Bitmap(16, 16))
{
using (Graphics prep = Graphics.FromImage(sample))
{
prep.Clear(this.BackColor);
}
sample.SetPixel(8, 8, Color.Black);
using (TextureBrush brush = new TextureBrush(sample))
{
e.Graphics.FillRectangle(brush, this.ClientRectangle);
}
}
}
And, of course, you'll get even better performance if you create the
TextureBrush only when necessary. In other words, you may also want to
cache
the TextureBrush so that you don't need to create it everytime the method
is
called.