Hi
I created a custom System.Windows.Forms.Panel so I could override the OnPaint event and make it draw a gray border, but the inside of the panel is picking up all kinds of gray lines when the window scrolls or anything moves over top of the panel. Does anyone know how to clean this up?
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawRectangle(
Pens.Gray,
e.ClipRectangle.Left,
e.ClipRectangle.Top,
e.ClipRectangle.Width - 1,
e.ClipRectangle.Height - 1);
base.OnPaint(e);
}