i have tried the code above . it works fine. but it only shows the breakdown of the costs. i want the label to show the total cost as well. what more should i add to the code?? please help</pre>
- Uncategorised posts -
2
Posts
2
Posters
7
Views
1
Watching
-
Private Sub btnTotalCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTotalCost.Click
lblTotalCost.Text = "YOU HAVE ORDERED:" & vbNewLine lblTotalCost.Text = lblTotalCost.Text & "ROOM TYPE" & vbNewLine & "--------" & vbNewLine If radLuxury.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Luxury = $210" & vbNewLine ElseIf radSuperior.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Superior = $150" & vbNewLine Else lblTotalCost.Text = lblTotalCost.Text & "Standard = $110" & vbNewLine End If lblTotalCost.Text = lblTotalCost.Text & vbNewLine & "MEAL OPTIONS" & vbNewLine & "--------" & vbNewLine If chkBufferBreakfast.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Buffer Breakfast = $40" & vbNewLine End If If chkBufferDinner.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Buffer Dinner = $60" & vbNewLine End If lblTotalCost.Text = lblTotalCost.Text & vbNewLine & "AMENITIES" & vbNewLine & "--------" & vbNewLine If chkInternet.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Internet = $10" & vbNewLine End If If chkEntertainment.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Entertainment = $20" & vbNewLine End If If chkSpaServices.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Spa Services = $50" & vbNewLine End If End Sub
-
Private Sub btnTotalCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTotalCost.Click
lblTotalCost.Text = "YOU HAVE ORDERED:" & vbNewLine lblTotalCost.Text = lblTotalCost.Text & "ROOM TYPE" & vbNewLine & "--------" & vbNewLine If radLuxury.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Luxury = $210" & vbNewLine ElseIf radSuperior.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Superior = $150" & vbNewLine Else lblTotalCost.Text = lblTotalCost.Text & "Standard = $110" & vbNewLine End If lblTotalCost.Text = lblTotalCost.Text & vbNewLine & "MEAL OPTIONS" & vbNewLine & "--------" & vbNewLine If chkBufferBreakfast.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Buffer Breakfast = $40" & vbNewLine End If If chkBufferDinner.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Buffer Dinner = $60" & vbNewLine End If lblTotalCost.Text = lblTotalCost.Text & vbNewLine & "AMENITIES" & vbNewLine & "--------" & vbNewLine If chkInternet.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Internet = $10" & vbNewLine End If If chkEntertainment.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Entertainment = $20" & vbNewLine End If If chkSpaServices.Checked Then lblTotalCost.Text = lblTotalCost.Text & "Spa Services = $50" & vbNewLine End If End Sub
You have already posted this in QA: How do I show total cost in a label when user selects random radio buttons and checkboxes?[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer