Thanks for the response, unfortunately the drawing problem still persists even after overriding the OnPaint as you suggested as well as the Draw Events....see below:
class GradientListView:System.Windows.Forms.ListView
{
public GradientListView()
{
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint |
ControlStyles.DoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
}
protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
{
base.OnDrawColumnHeader(e);
}
protected override void OnDrawItem(DrawListViewItemEventArgs e)
{
base.OnDrawItem(e);
}
protected override void OnDrawSubItem(DrawListViewSubItemEventArgs e)
{
base.OnDrawSubItem(e);
}
protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent)
{
PaintRectangle(this.ClientRectangle, this.BackColor, Color.Black, pevent.Graphics);
}
protected void PaintRectangle(Rectangle Rect, Color RectColor, Color RectBorderColor, Graphics g)
{
LinearGradientBrush brush;
Rectangle BottomRect;
BottomRect = new Rectangle(Rect.X, Rect.Height-((int)(Rect.Height / 2)), Rect.Width, Rect.Height / 2);
brush = new LinearGradientBrush(
Rect,
RectColor,
Color.White,
45);
g.FillRectangle(brush, Rect);
brush.Dispose();
}
}
Any other thoughts ? -- modified at 11:43 Monday 23rd October, 2006