Solved

Count the number of items in a listbox using C#

Posted on 2007-12-03
3
2,535 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 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