Solved

Count the number of items in a listbox using C#

Posted on 2007-12-03
3
2,523 Views
Last Modified: 2010-04-21
Let me say this upfront - I'm extremely new to using C# so bare with me.
I have simpe app that allows the user to select a folder and renames all the files within that folder. I've got it now to show in a listbox the files within that folder before and after the rename. Now I want to show the total number of files in the folder somewhere in the app.
So they no they've renamed them all. i.e. "Total Files: 122"
How the heck do you do that?
Thanks for the lesson
0
Comment
Question by:DFCRJ
  • 2
3 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 20395218
this.Label1.Text = "Total Files: " + this.ListBox1.Items.Count;

Bob
0
 

Author Comment

by:DFCRJ
ID: 20395231
why do I make things so hard...works like a charm!!!
thanks so much..
0
 

Author Closing Comment

by:DFCRJ
ID: 31412306
perfect
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question