Listview cell colours...

lidds
12-05-2004, 05: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 vb.net that would be great.

Cheers

Simon

excaliber
12-05-2004, 06: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