Is there an equivalent to the System.Windows.Forms.ControlPoint.DrawGrid in
the .NET 2.0 Compact Framework? I'd like to find a way to easily draw a
grid on my form.
Thanks,
Wade
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.
--
Tim Wilson
.NET Compact Framework MVP
"Wade" <wwegner23NOEMAILhotmail.com> wrote in message
news:u6obub5R...@TK2MSFTNGP11.phx.gbl...
Isn't there a way to do owner draw in CF 2.0? I thought I heard it was
new for CF 2.0.
--
Tim Wilson
.NET Compact Framework MVP
"Jim" <jimp...@mobiledynamo.com> wrote in message
news:1142395475.6...@i40g2000cwc.googlegroups.com...
"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
news:ukPCwi8R...@TK2MSFTNGP09.phx.gbl...