I'm doing a project that requires me to create a book ordering form. I have the books displayed in a listbox named bookselectionlistbox, and when a book is selected, it displays the price of that book in a label named bookpricelabel1. I have a button named addbutton that allows the user to add the book to the shopping cart. The shopping cart is in the form of a combobox named shoppingcartcombobox. Lastly, there is a receipt button that transfers ALL the books from the shopping cart to a seperate label called label3, not just the selected book. The last thing I need to do is have the price of each book also transfer to the receipt section. This needs to be done either on the same label3 on the same line as the book title, or on a seperate label that is adjacent to label3, I have temporarily placed a label there named label5. I am using a case statement for the bookselectionlistbox to say that when a certain book is selected, the bookpricelabel1 will display "$xx". I also have an IF statement under the addbutton label that generates a total price for all the books in the shopping cart, here is an example of the code I used for one of the books:
[Dim visualbasic As Decimal]
[If shoppingcartComboBox.Items.Contains("Visual Basic") Then]
[visualbasic = 55]
[Else]
[visualbasic = 0]
[End If]
[Me.bookpriceLabel2.Text = visualbasic + java + c + lannetworks + windowsnetworking +] [moreaboutnetworking + webprogramming + javascript + asp]
The code I used to transfer ALL the shoppingcartcombobox data to label3 is:
[Dim items As String]
[ For Each item As String In shoppingcartComboBox.Items]
[ items &= item & vbCrLf]
[ Next]
[ Label3.Text = items]
So I just need to populate the individual book prices now and I'm done, thanks in advance for any help, it's very appreciated. I've been stuck on this one part for a while and look forward to getting over it :)