C# WinForm 控件美化之改变ListView Head 的背景色

     // 需要设置ListView的OwnerDraw属性为 true

// 用以改变标题的颜色
private void listView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.Graphics.FillRectangle(
new SolidBrush(Color.Red), e.Bounds);
e.DrawText();
}

private void listView_DrawItem(object sender, DrawListViewItemEventArgs e)
{
e.DrawDefault
= true;
}
 
posted @ 2011-05-31 17:01  把爱延续  阅读(9574)  评论(1编辑  收藏  举报