473,513 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Add the values of a listbox

8 New Member
Hi all. Lets just say I have a listbox of full of values. Can someone help me write some code to add all the numerical values of the listbox? Thanks
Dec 14 '07 #1
5 1486
debasisdas
8,127 Recognized Expert Expert
What do you mean by all the numerical values of the listbox .
What exactly are you trying to do ?
Dec 14 '07 #2
ss112358
8 New Member
What do you mean by all the numerical values of the listbox .
What exactly are you trying to do ?
Thankyou for your reply. I have a listbox with numerical values that the user enters. I then want to find the total sum of all the values in the listbox.

Thanks again
Dec 14 '07 #3
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Loop from 0 to (List1.ListCount-1) and write the code to add..


Regards
Veena
Dec 14 '07 #4
ss112358
8 New Member
Hi,

Loop from 0 to (List1.ListCount-1) and write the code to add..


Regards
Veena
Can you please give me an example? I am getting confused.. Thanks
Dec 14 '07 #5
debasisdas
8,127 Recognized Expert Expert
Can you please give me an example? I am getting confused.. Thanks
There is nothing to get confused. Retrive all the values using the listindex peoperty . You need to add the values in a loop. You will not learn anything till you try yourself.

Kindly post what you have tried so far for further discussion on the topic.
Dec 14 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
2571
by: Dave Hopper | last post by:
Hi I posted a question recently regarding problems I am having getting a value from a list box to use in a query. I got a lot of help, for which I thank you and it's nearly working! But I need...
1
1611
by: dburns | last post by:
I have an unbound ListBox and an unbound ComboBox on the same form. I have them both set up to display the values from the same field in the same table. The ListBox displays the correct values; the...
6
5181
by: Janaka | last post by:
Help! I have two ListBox controls on my web form. The first one gets populated on entry with values from the DB. I then use JavaScript to copy options from this ListBox to my second one. (I...
6
2645
by: Niggy | last post by:
Hi there, I would like to display the values of the index as chosen by the user in a listbox. These values would be as per the datavaluefield. On testing I get a value of -1: Private Sub...
0
1675
by: Dave | last post by:
Hi all, I have a listbox that is complex bound by an arraylist. The problem is that when I delete an object from the arraylist, the listbox does not reflect those changes. I tried refreshing...
7
4067
by: technocraze | last post by:
Hi guys, I encountered this error while using the AfterUpdate event for my listbox. Error: Update or CancelUpdate without using AddNew or Edit. What i wanted to achieve is just to display the...
1
2483
by: Intrepid_Yellow | last post by:
Hi, I have the following code that runs my report generator. The user selects a table from a combo box, then whatever fields they want from a list box. (This part all works and the report runs...
1
2010
by: melvincwmah | last post by:
I have a form in which I would link the form fields to tables in the SQL database. Right now, I want to put in a listbox that will show three columns from a table called IssueAudit. The...
6
4140
by: Pippen | last post by:
Hi, I'm trying to read all the selected items in a ListBox. So after the user selects the values they want in the ListBox they select a button. This is where I want to put into a string all the...
3
3754
by: Renilkumar | last post by:
Hi, I am using .net 2.0. I have a .aspx page with vb.net as codebehind. My form has one dropdown, 2 listboxes with add & remove button. During pageload I am loading all the values from the db to...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.