Does any body know how to change the backcolor of a ListViewItem and that of a ListViewItem.SubItem.
The BackColor property does not work.
Printable View
Does any body know how to change the backcolor of a ListViewItem and that of a ListViewItem.SubItem.
The BackColor property does not work.
Dear Friend, there is a property that can lock a subitem (UseItemStyleForSubItems ). You must set it to a False value:
Dim Elenco As ListViewItem
Elenco = Me.LswFatture.Items.Add(Me.StrContatto)
If Elenco.Index < 3 Then
Elenco.BackColor = System.Drawing.Color.Red
End If
Elenco.UseItemStyleForSubItems = False
Elenco.SubItems.Add(Me.StrNumDoc)
Elenco.SubItems.Add(Me.StrData)
Elenco.SubItems(1).BackColor = System.Drawing.Color.DarkOrange
In the code above I put a Red color in the first subitem (the first column on the left), for the first 3 rows.
For any rows, I put a background color = DarkOrange on the second column. The effect is awful, but the example is useful I hope:)
Good job
Thanx a lot alextyx.
It was quit helpful.