473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Need help with writing code for a pricing system

Hi

I'm very new to Visual Basic .Net, I am stuck on a piece of programming and
in need of some help!

I don't know whether I should be using a 'For... Next Loop' or a 'Do...
Loop' (?) The calculation involves 7 checkboxes (of different values), that
should be added together (when selected), and then multiplied to create a
'total cost'

Any hints or tips would be greatly appreciated

Many thanks

Jul 24 '05 #1
2 1473
Brad, To use either, you will need the checkboxs in a collection (or array)
of some sort. The easy way to do this is the put a panel on your form and
then put the checkboxes in the panel. The checkboxes will now be in the
controls collection of the panel and you can use a "foreach" to loop through
the collection.

Depending on your newness to vb and programming, you might want to pick to
some of the book MS recommends on their vb site. The system is lot to get
your arms around with out some documentation to give you a framework.

Best of luck...Chuck
Jul 24 '05 #2
Brad,

My idea is, forever when you can use a for (index) or foreach in VBNet, than
use those.

If you set (only) those checkboxes by instance in a seperated groupbox than
you can do (roughly typed in htis message and assuming that you have set the
value in the text)

\\\
dim totalvalue as Integer
for each chk as control in groupbox1.controls
dim chkbox = directcast(chk,checkbox)
'with this you can handle it as a checkbox
if directcast(chkbox, checkbox).checked then
totalvalue = Cint(chkbox.text)
end if
next
///

I hope this helps,

Cor
Jul 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
28
by: Jed | last post by:
Hello to all! I have a couple of projects I intend starting on, and was wondering if someone here could make a suggestion for a good compiler and development environment. My goals are as...
13
by: Trint Smith | last post by:
Ok, On my website, tribidz.com, there is one page that needs to not have any buttons or menu or address bar. How can I do this? What is the html code or whatever? Thanks, Trint ..Net...
1
by: Milsnips | last post by:
i'm sure i should know how to do this, but its been a while with SQL: i have 2 tables.. 1. Pricing 2. Request Pricing has about 10 records with pricingID being primary. Request has a field...
2
by: bradbretao | last post by:
Hi I'm very new to Visual Basic .Net, I am stuck on a piece of programming and in need of some help! I don't know whether I should be using a 'For... Next Loop' or a 'Do... Loop' (?) The...
6
by: xansar | last post by:
I have searched through Google for about an hour with nothing to show for it. I'm pretty sure I'm doing the actual return part right, but I'm not too sure what to do with the return once it's back in...
1
by: Gilberto | last post by:
Hello, I have two tables: COSTING and PRICING, both with the following fields: product name French packaging transportation ddp I want to create a query so that from a text box in the...
3
by: rassklass | last post by:
HI all, I have designed a site found at www.pickupnewspapers.co.uk/nottinghamshire/index.html but I cant get the footer to sit stil on the page. It is because of the javascript ticker, everytime...
1
by: donpur | last post by:
In Visual Basic I am attempting to write a formula that includes an explanation point out to an Excel cell. When I do, Excel puts extra single quotes into the formula. For example the following:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.