| | |
How do I check how MANY items a listbox has?
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
For instance in a "For" loop:
What could I place after the "." at the end to check so it doesn't keep on working after the number of items?
C# Syntax (Toggle Plain Text)
for(int i = 0;i<=listBox1.
What could I place after the "." at the end to check so it doesn't keep on working after the number of items?
My very first baby boy, coming December 2008. :D
•
•
Join Date: Jun 2008
Posts: 58
Reputation:
Solved Threads: 9
try something like this:
for (int i = 0; i < listBox1.Items.Count; i++)
make sure it's i < and not i <= since you are starting with index 0.
Good luck
for (int i = 0; i < listBox1.Items.Count; i++)
make sure it's i < and not i <= since you are starting with index 0.
Good luck
Visual C# Kicks - Free C# code resources and articles.
Read the intellisense of the property, it will help you. I think you did not do some efforts... hehehehe no offense meant, that's for your own good. if problem persist consult your f***n brilliant mind, I know you have lots of guts!!!
regards.
regards.
A conclusion is the place where you got tired of thinking. http://www.martin2k.co.uk/forums/index.php?showforum=4
http://www.a1vbcode.com/a1vbcode/vbforums/Forum3-1.aspx
http://www.developerfusion.co.uk/for...orum&ForumID=4
![]() |
Similar Threads
- Copy Items from one listbox to another (Visual Basic 4 / 5 / 6)
- [Need Help with Listbox in VB.NET] (VB.NET)
- Individual coloring of items in listbox (Visual Basic 4 / 5 / 6)
- Windows Forms Listbox (VB.NET)
- changing the colour of an individual item in a listbox? (Pascal and Delphi)
- Problem with Listbox (Visual Basic 4 / 5 / 6)
- Saving information from .NET Listbox into SQL Server 2000 (ASP.NET)
- Combo Box (C++)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the C# Forum
- Previous Thread: Query Builder
- Next Thread: arraylist
Views: 783 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client code combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ http httpwebrequest image index input install label list listbox listener login mandelbrot math mouseclick mysql networking operator oracle path photoshop picturebox pixelinversion prime programming radians regex remote remoting resource richtextbox save saving serialization server socket sql statistics stream string table tcp text textbox time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





