Count items in Listview

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

To count all the item in currently in my listview, i use
this.TotalMessages = myListView.Items.Count;

What can I use to count the number of item in the list box that has the
ImageIndex of 0?

Thanks

JB
 
int image0Count = 0;
for( int i; i < myListView.Items.Count; i++ )
{
if( myListView.Items[ i ].ImageIndex == 0 )
{
image0Count++;
}
}
return image0Count;
 
Back
Top