Well at this point I think it's safe to say coding is not my thing, have another problem I am working on, have the code close to correct I believe, problem, when one of the radio buttons is selected, there should be another groupbox that shows (depending on which radio button) that you can select check boxes from (items), once selections are made you select place order and it displays the correct values. For what ever reason I can not get the values, nor the groupbox with items to display to select from. What am I doing wrong? Thanks in advance!
Partial Public Class frmLunchOrders
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub radHamburger_CheckedChanged(sender As Object, e As EventArgs)
If radHamburger.Checked = True Then
lstOrderDetails.Visible = False
chkLettuce.Visible = True
chkKetchup.Visible = True
chkFrench.Visible = True
txtSubtotal.Text = ""
txtTax.Text = ""
txtOrderTotal.Text = ""
chkLettuce.Text = "Lettuce, Tomato, and Onions"
chkKetchup.Text = "Ketchup, Mustard, and Mayo"
chkFrench.Text = "French Fires"
grpAddHamburger.Text = "Add-on items ($.75/each)"
chkLettuce.Checked = False
chkKetchup.Checked = False
chkFrench.Checked = False
End If
End Sub
Private Sub radPizza_CheckedChanged(sender As Object, e As EventArgs)
If radPizza.Checked = True Then
lstOrderDetails.Visible = False
chkPepperoni.Visible = True
chkSausage.Visible = True
chkOlives.Visible = True
txtSubtotal.Text = ""
txtTax.Text = ""
txtOrderTotal.Text = ""
chkPepperoni.Text = "Pepperoni"
chkSausage.Text = "Sausage"
chkOlives.Text = "Olives"
grpAddPizza.Text = "Add-on items ($.50/each)"
chkPepperoni.Checked = False
chkSausage.Checked = False
chkOlives.Checked = False
End If
End Sub
Private Sub radSalad_CheckedChanged(sender As Object, e As EventArgs)
If radSalad.Checked = True Then
lstOrderDetails.Visible = False
chkCroutons.Visible = True
chkBacon.Visible = True
chkBread.Visible = True
txtSubtotal.Text = ""
txtTax.Text = ""
txtOrderTotal.Text = ""
chkCroutons.Text = "Croutons"
chkBacon.Text = "Bacon Bits"
chkBread.Text = "Bread Sticks"
grpAddSalad.Text = "Add-on items ($.25/each)"
chkCroutons.Checked = False
chkBacon.Checked = False
chkBread.Checked = False
End If
End Sub
Private Sub btnPlaceOrder_Click(sender As Object, e As EventArgs)
lstOrderDetails.Visible = True
btnPlace.Visible = False
grpMain.Visible = False
If radHamburger.Checked = True Then
lstOrderDetails.Items.Add("Hamburger - $6.95")
Dim subtotal As Double = 6.95
Dim addOnItems As Double = 0
If chkLettuce.Checked = True Then
lstOrderDetails.Items.Add("Lettuce, Tomato, Onion - $0.75")
addOnItems = addOnItems + 0.75
End If
If chkKetchup.Checked = True Then
lstOrderDetails.Items.Add("Ketchup, Mustard, Mayo - $0.75")
addOnItems = addOnItems + 0.75
End If
If chkFrench.Checked = True Then
lstOrderDetails.Items.Add("French Fries - $0.75")
addOnItems = addOnItems + 0.75
End If
subtotal = (subtotal + addOnItems)
Dim tax As Double = subtotal * 0.0775
Dim orderTotal As Double = subtotal + tax
txtSubtotal.Text = subtotal.ToString("c")
txtTax.Text = tax.ToString("c")
txtOrderTotal.Text = orderTotal.ToString("c")
lstOrderDetails.Items.Add("---------------------------------------------")
End If
If radPizza.Checked = True Then
lstOrderDetails.Items.Add("Cheese Pizza - $5.95")
Dim subtotal As Double = 5.95
Dim addOnItems As Double = 0
If chkPepperoni.Checked = True Then
lstOrderDetails.Items.Add("Add Pepperoni - $0.50")
addOnItems = addOnItems + 0.5
End If
If chkSausage.Checked = True Then
lstOrderDetails.Items.Add("Add Sausage - $0.50")
addOnItems = addOnItems + 0.5
End If
If chkOlives.Checked = True Then
lstOrderDetails.Items.Add("Add Olives - $0.50")
addOnItems = addOnItems + 0.5
End If
subtotal = (subtotal + addOnItems)
Dim tax As Double = subtotal * 0.0775
Dim orderTotal As Double = subtotal + tax
txtSubtotal.Text = subtotal.ToString("c")
txtTax.Text = tax.ToString("c")
txtOrderTotal.Text = orderTotal.ToString("c")
lstOrderDetails.Items.Add("---------------------------------------------")
End If
If radSalad.Checked = True Then
lstOrderDetails.Items.Add("Salad - $4.95")
Dim subtotal As Double = 4.95
Dim addOnItems As Double = 0
If True Then
If chkCroutons.Checked = True Then
lstOrderDetails.Items.Add("Add Croutons - $0.25")
End If
addOnItems = addOnItems + 0.25
End If
If chkBacon.Checked = True Then
lstOrderDetails.Items.Add("Add Bacon Bits - $0.25")
addOnItems = addOnItems + 0.25
End If
If chkBread.Checked = True Then
lstOrderDetails.Items.Add("Add Bread Sticks - $0.25")
addOnItems = addOnItems + 0.25
End If
subtotal = (subtotal + addOnItems)
Dim tax As Double = subtotal * 0.0775
Dim orderTotal As Double = subtotal + tax
txtSubtotal.Text = subtotal.ToString("c")
txtTax.Text = tax.ToString("c")
txtOrderTotal.Text = orderTotal.ToString("c")
lstOrderDetails.Items.Add("---------------------------------------------")
End If
grpTotal.Text = "Order Details"
End Sub
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub clearTotals(sender As Object, e As EventArgs)
txtSubtotal.Text = ""
txtTax.Text = ""
txtOrderTotal.Text = ""
End Sub
End Class