Hi,
Different colors per line in a ListView
How can I drew Different colors per line in a ListView ?
Thanks in advance
Printable View
Hi,
Different colors per line in a ListView
How can I drew Different colors per line in a ListView ?
Thanks in advance
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)
Hi,
I found the answer:
ThanksCode: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