How can you change the background color of the Headers of a ListView?
Here's an example that shows how it can be done using a custom control.
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22666674.html
Edit: Ugh, stupid Expert's Exchange. You might have better luck with Google's cached version:
You can do this by setting the OwnerDraw property for the list view to true.
This then allows you to provide event handlers for the listview's draw events.
There is a detailed example on MSDN
Below is some example code to set the header colour to red:
private void listView1_DrawColumnHeader(object sender,
DrawListViewColumnHeaderEventArgs e)
{
e.Graphics.FillRectangle(Brushes.Red, e.Bounds);
e.DrawText();
}
I think (but am happy to be proved wrong) that with OwnerDraw set to true, you will need to also provide handlers for the other draw events that have default implementations as shown below:
private void listView1_DrawItem(object sender,
DrawListViewItemEventArgs e)
{
e.DrawDefault = true;
}
I certainly haven't managed to make the listview draw the items without that.