Listview cell colours...

12-05-2004, 06:13 AM
I have a listview that has two columns (name, colour) and 2 rows. What I am trying to do is change the background colour of each of the colour cells to different colours. e.g. column 2 row 1 background colour should be red and column 2 row 2 background colour should be blue.

If anyone could provide me with some sample code in that would be great.



12-05-2004, 07:32 AM
'-first row, first column
myListView.Items(0).SubItems(0).BackColor = System.Drawing.Color.Goldenrod
'-first row, second column
myListView.Items(0).SubItems(1).BackColor = System.Drawing.Color.Honeydew
'-second row, first column
myListView.Items(1).SubItems(0).BackColor = System.Drawing.Color.Khaki
'-second row, second column
myListView.Items(1).SubItems(1).BackColor = System.Drawing.Color.DarkKhaki
'-Etc etc

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum