Hi. I am extremely new to programming and have been asked to create a simple point of sale receipt application using VB.NET. Here are my tasks.
> the application adds items to a sales receipt one at a time using an input text box and an “Add to Receipt” button
> each time the “Add to Receipt” button is pressed, the new item price is added to a list box control which acts as the receipt and the input text box is cleared for the next entry
> the application should also contain output labels for subtotal, sales tax (13%), and total that should be updated whenever an item is added to the receipt
> the program should use a constant for the sales tax
> the application should be formatted with dollar symbols and two decimal places (for cents)
> the application also includes a clear button which when pressed clears everything and allows the user to start a brand new sales receipt.
> the application also includes an Exit button that will shut down the application when clicked
- The problem I am having is how to actually calculate everything within the receipt list box and spit it into the subtotal / sales tax / and totals text boxes.
- I have tried looking for some function through the listbox.Items functions but have had no luck in finding something that allows me to add all of the items inside together.
- Here is a picture of my form if this helps http://i54.tinypic.com/29auxqe.jpg
- I have provided my code below to show what
-Thank you in advance.
Public Class frmMain
'constants / declares
Const NUMA1TAX As Integer = 0.13
Dim precision As Integer = 2
Private Sub btnAddToReceipt_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddToReceipt.Click
Private Sub btnClear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClear.Click
lstSalesReceiptOutput.Text = ""
Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click