• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2564
  • Last Modified:

Count the number of items in a listbox using C#

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
  • 2
1 Solution
Bob LearnedCommented:
this.Label1.Text = "Total Files: " + this.ListBox1.Items.Count;

DFCRJAuthor Commented:
why do I make things so hard...works like a charm!!!
thanks so much..
DFCRJAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now