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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top