Click here to Skip to main content
12,829,079 members (41,754 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET
hi all,

I have a listbox and textbox in c# language
I need to add the sum of all values in to a listbox using text box , when i enter something it will add list box and again i will do the same flow it will come one by one .

please give me any idea or any code its very urgent.

thanks in advance.
Posted 13-Feb-13 2:55am
ryanb31 13-Feb-13 7:56am
You can use javascript. What do you have so far?
Jαved 13-Feb-13 8:03am
Not clear, exactly what do you want to do?
Maciej Los 13-Feb-13 8:04am
Is this your homework? If yes, do it yourself!
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It looks a quite elementary task to me. What have you tried so far?
You may code a method for summing up all list box items and another method for adding text box content to the list box..
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

please give me any idea

You might be using an event to add item(a button perhaps). If yes, use onclick event of the button. In that event create a new listitem(a listbox is a collection of listitems) and use ListBox's Add event to add the new item at the specified position. Give it a try. For a start:
ListBox.Item.Insert(int index, ListItem item);
its very urgent

I don't think so :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170326.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100