Re: [2008] Different colors per line in a ListView
Like so;
Code:
Dim l As New ListViewItem
l.Text = "AAA"
'Use this if you want the sub-items to look the same
l.UseItemStyleForSubItems = True
l.ForeColor = Color.Red
l.BackColor = Color.Black
ListView1.Items.Add(l)
Re: [2008] Different colors per line in a ListView
Hi,
I found the answer:
Code:
For index = 0 To ListView.Items.Count - 1
If index Mod 2 = 0 Then
ListView.Items(index).BackColor = Color.LightYellow
ListView.Items(index).ForeColor = Color.Blue
Else
ListView.Items(index).BackColor = Color.LightBlue
ListView.Items(index).ForeColor = Color.Red
End If
Next