Friday, May 16, 2008

How to change background color of Listview in C#

Hello guyz. I have simple code here to change the background color of Listview and it's cells during runtime.

Step 1:
Create first a Listview.

Step 2:
Put this code at your form_load event.

listView1.Items.Add("Hello World");
listView1.Items[0].SubItems[0].BackColor = Color.Blue;