Solved

Count the number of items in a listbox using C#

Posted on 2007-12-03
3
2,502 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
Comment Utility
this.Label1.Text = "Total Files: " + this.ListBox1.Items.Count;

Bob
0
 

Author Comment

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

Author Closing Comment

by:DFCRJ
Comment Utility
perfect
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now