Count Items in certain forecolor in listview

  • Thread starter Thread starter Heartland
  • Start date Start date
H

Heartland

Hi,

I have a listview with the items in different colors
(forecolor). I know how to count total number of items in
a listview. But how do I count the items in certain color?

Thanks.

Heartland
 
* "Heartland said:
I have a listview with the items in different colors
(forecolor). I know how to count total number of items in
a listview. But how do I count the items in certain color?

Loop through the items and compate the color (untested):

\\\
Dim lvi As ListViewItem
For Each lvi In Me.ListView1.Items
If lvi.ForeColor.Equals(Color.Red) Then
...
End If
Next lvi
///
 
Thanks very much, Herfried, for your tip. I was thinking
the same way. But my condition sytext did not work. I was
struggling with ListView.Items(i).Forecolor =
System.drawing.Color.Red. You made my day.
Thanks again.

Heartland
 
Back
Top