Monday, May 16, 2011

How To change the BackColor of listview

May be you have tried this code below :
.
ListView1.Items(0).SubItems(1).BackColor = Color.Red

.
But It does not work,
The trick is that you should add this line of code when you add new ListviewItem

Dim lvi As New ListViewItem 
lvi.UseItemStyleForSubItems =False
'To disable the style from the subitems

ListView1.Items.Add(lvi)

Simple things sometimes give you alot of headache
.

No comments:

Post a Comment