Welcome to Dream.In.Code
Become a VB Expert!

Join 149,482 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,407 people online right now. Registration is fast and FREE... Join Now!




ListView Box Totals

 
Reply to this topicStart new topic

ListView Box Totals, Please Help

Persistant
27 Apr, 2007 - 02:11 PM
Post #1

New D.I.C Head
*

Joined: 5 Apr, 2007
Posts: 28


My Contributions
Can someone tell me how I would go about using a For...Each...Next statement to get a total of items in a list view box where some are on sale and a check box is checked and some are not on sale. I have all of the code except the part that totals the items on sale and items at regular price. All I need is an example.


User is offlineProfile CardPM
+Quote Post

AdmSteck
RE: ListView Box Totals
1 May, 2007 - 07:15 AM
Post #2

D.I.C Head
**

Joined: 26 Nov, 2005
Posts: 57


My Contributions
QUOTE(Persistant @ 27 Apr, 2007 - 03:11 PM) *

Can someone tell me how I would go about using a For...Each...Next statement to get a total of items in a list view box where some are on sale and a check box is checked and some are not on sale. I have all of the code except the part that totals the items on sale and items at regular price. All I need is an example.


Can you describe the checkbox for sale items? How are the price of each item stored?

An example of a for each would be:
CODE
dim total as single
for each item as listboxitem in listbox.items
     total = total + item.value
next


The variable types might not be right.
User is offlineProfile CardPM
+Quote Post

Persistant
RE: ListView Box Totals
1 May, 2007 - 01:21 PM
Post #3

New D.I.C Head
*

Joined: 5 Apr, 2007
Posts: 28


My Contributions
QUOTE(AdmSteck @ 1 May, 2007 - 08:15 AM) *

QUOTE(Persistant @ 27 Apr, 2007 - 03:11 PM) *

Can someone tell me how I would go about using a For...Each...Next statement to get a total of items in a list view box where some are on sale and a check box is checked and some are not on sale. I have all of the code except the part that totals the items on sale and items at regular price. All I need is an example.


Can you describe the checkbox for sale items? How are the price of each item stored?

An example of a for each would be:
CODE
dim total as single
for each item as listboxitem in listbox.items
     total = total + item.value
next




The variable types might not be right.

Thanks for the input but it doesn't matter now. I had to turn the assignment in and should have the answer within a week, just in case anyone else runs across this problem. I appreciate you guys in the forum because you are all the help I have and I feel sure I am not alone in this matter.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 04:32PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month