473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Count items in Listview

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
Nov 17 '05 #1
1 40421
int image0Count = 0;
for( int i; i < myListView.Items.Count; i++ )
{
if( myListView.Items[ i ].ImageIndex == 0 )
{
image0Count++;
}
}
return image0Count;

"Jbatty" wrote:
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

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dinesh Jain | last post by:
Hi all, I encountered a strange problem with listview. Sometimes(not always)even if one item is selected in listview, still listview.selectedItems.count returns 0. What can be the reason ? I...
3
by: Holmes | last post by:
Hello Ran into a bit of a problem here and have now exhausted my resources to getting this working What I am trying to do is load and show a simple vb form with a listbox in it Dim...
10
by: Henry | last post by:
Does anyone know how I can determine how many visible rows there are in a vb.net Listview? There is no listview "visible row count" property like there is for a datagrid. Tks in advance for any...
4
by: Jon | last post by:
hi, I have a for loop, which runs through all the rows in a listview. however, i added some new rows within the for loop.. so my problems now is that it doesn't loop thru the whole table, but...
6
by: Nick | last post by:
Hi there, I'm trying to implement drag-drop for my listview control in large icon view mode. Unfortunately the order of the items gets completely messed up upon inserting the item back into the...
1
by: OpticTygre | last post by:
I have a listview where users can add items via a textbox and an 'add' button. The problem is, the code below doesn't work for keeping duplicates entered. If I create a ListViewItem with the same...
3
by: RT | last post by:
Is there any way to make Listview items invisible or otherwise keep them from displaying? Seems like temporarily removing, then restoring later would be a severe runtime hit.
0
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.