• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2567
  • 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
0
DFCRJ
Asked:
DFCRJ
  • 2
1 Solution
 
Bob LearnedCommented:
this.Label1.Text = "Total Files: " + this.ListBox1.Items.Count;

Bob
0
 
DFCRJAuthor Commented:
why do I make things so hard...works like a charm!!!
thanks so much..
0
 
DFCRJAuthor Commented:
perfect
0
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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