Im trying to make a fast food program on which the user will input the amount that he has, then he will click on what he wants, by using check boxes. There are 7 different check boxes with 7 different amounts of money. I got an idea on what to do (they will check on what they want and the program will add up the total and there is only one of each item), but im confused on how to put the amount on where the check boxes (in the program area and not the text area) and add them together. After that all I need to do is add everything up, with sales tax, and tell the user if he has enough money or not. But what im confused on is how do I get the check boxes to a amount of money and add them up (all the ones hes checked) I just dont know how to code this part of the program, once I get one done all I have to do is the same for each one, and everything showed be easy after that. But how do I put an amount on a check box and add them all up?
rookanga
0
Junior Poster in Training
Recommended Answers
Jump to PostSee if this helps.
Public Class Form1 '// Prices for the CheckBoxes as Decimal Arrays. Private myCoolCheckBoxPrices() As Decimal = {2, 3.5, 4.35, 1.75, 5, 9.99, 0.75} '// To get the value of the 3rd Array, since Index based, you would use: myCoolCheckBoxPrices(2) Private Sub Button1_Click(ByVal sender …
Jump to PostThere are a number of ways to do this.
Personally, I wouldn't use checkboxes. What if I want more than one item? But then, I don't know your requirements.
Anyway, on to answering your question:
if you aren't using databinding (I would), you could put the itemID into …
All 5 Replies
codeorder
197
Nearly a Posting Virtuoso
CodeWord
6
Junior Poster in Training
rookanga
0
Junior Poster in Training
codeorder
197
Nearly a Posting Virtuoso
rookanga
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.