所以我必须做一个购物车程序而且我没有在大多数情况下,但我无法弄清楚我将如何处理从购物车中删除的物品? 关于我将如何使用的建议将不胜感激
Public Class Form1
Dim subTotal As Decimal
Dim tax As Decimal
Dim itemCount As Integer
Dim shipping As Integer
Dim total As Decimal
Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub IDidItYourWay1195ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles IDidItYourWay1195ToolStripMenuItem.Click
shoppingLB.Items.Add("I Did It Your Way $11.95")
subTotal = subTotal + 11.95
itemCount = itemCount + 1
End Sub
Private Sub TheHistoryOfScotland1450ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TheHistoryOfScotland1450ToolStripMenuItem.Click
shoppingLB.Items.Add("The History of Scotland $14.50")
subTotal = subTotal + 14.5
itemCount = itemCount + 1
End Sub
Private Sub LearnCalculusInOneDay2995ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LearnCalculusInOneDay2995ToolStripMenuItem.Click
shoppingLB.Items.Add("Learn Calculus in One Day $29.95")
subTotal = subTotal + 29.95
itemCount = itemCount + 1
End Sub
Private Sub FeelTheStress1850ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FeelTheStress1850ToolStripMenuItem.Click
shoppingLB.Items.Add("Feel the Stress $18.50")
subTotal = subTotal + 18.5
itemCount = itemCount + 1
End Sub
Private Sub LearnCalculusInOneDay2995ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles LearnCalculusInOneDay2995ToolStripMenuItem1.Click
shoppingLB.Items.Add("Learn Calculus in One Day $29.95")
subTotal = subTotal + 29.95
itemCount = itemCount + 1
End Sub
Private Sub TheHistoryOfScotland1450ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles TheHistoryOfScotland1450ToolStripMenuItem1.Click
shoppingLB.Items.Add("The History of Scotland $14.50")
subTotal = subTotal + 14.5
itemCount = itemCount + 1
End Sub
Private Sub TheScienceOfBodyLanguage1295ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TheScienceOfBodyLanguage1295ToolStripMenuItem.Click
shoppingLB.Items.Add("The Science of Body Language $12.95")
subTotal = subTotal + 12.95
itemCount = itemCount + 1
End Sub
Private Sub RelaxationTechniques1150ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RelaxationTechniques1150ToolStripMenuItem.Click
shoppingLB.Items.Add("Relaxation Techniques $11.50")
subTotal = subTotal + 11.5
itemCount = itemCount + 1
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
shipping = itemCount * 2
tax = subTotal * 0.06
total = subTotal + tax + shipping
taxTxt.Text = FormatCurrency(tax)
shippingTxt.Text = FormatCurrency(shipping)
subTxt.Text = FormatCurrency(subTotal)
totalTxt.Text = FormatCurrency(total)
End Sub
Private Sub removeBtn_Click(sender As Object, e As EventArgs) Handles removeBtn.Click
End Sub
End Class