Hi guys,
Do you know how to put a color font the data in the ListView please.
So, I want the 1st row with red font, the 2nd row with blue color, 3rd row red again and so on.
Does anyone know how to do this please.
Thank you.
Printable View
Hi guys,
Do you know how to put a color font the data in the ListView please.
So, I want the 1st row with red font, the 2nd row with blue color, 3rd row red again and so on.
Does anyone know how to do this please.
Thank you.
Set the ForeColor property of each item. You'll need to set the UseItemStyleForSubItems property to True or else only the first column will be coloured.
Could you give me an example please.
How about you give it a try and we'll help fix it if it doesn't work. The best way to learn is to do.
Please have a look at tha attachement.
I want the listView look similar like that, but only 1 row is red, 2nd is blue, 3rd is red again and so on.
Thank you.
Can you post your code what you did? how you populate the listview as above, so that we can help you.,
'Dim Itema = New ListViewItem
'For Each Itema In ListView1.Items
' If (Itema.Index Mod 2) = 0 Then
' 'Itema.BackColor = Color.Red
' Itema.ForeColor = Color.Red
' Else
' 'Itema.BackColor = Color.Yellow
' Itema.ForeColor = Color.Yellow
' End If
'Next
that code take ages. longtime to load if I combine uploading the date into the ListView.
Is there a way to load faster?
jmchilhinney, do you know how to do this faster? or anyone please?
thank you
I think we've already discussed this in another thread but you should call BeginUpdate first and EndUpdate last. Otherwise the ListView will be redrawn after each item is changed or added. The continual redrawing makes things very slow.