0% found this document useful (0 votes)
39 views3 pages

Form1 Object Eventargs: "Coffee" "Tea"

This document contains the code for a Visual Basic .NET Windows Forms application that allows a user to select a drink, flavor, size and quantity and calculates the total cost. It includes code to: 1) Populate two combo boxes with drink and flavor options when the form loads. 2) Clear and populate the flavor combo box differently depending on the selected drink. 3) Calculate the price for each size/drink/flavor combination and display the selected options and total cost on a second form when the user clicks the order button.

Uploaded by

kishi8mempin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views3 pages

Form1 Object Eventargs: "Coffee" "Tea"

This document contains the code for a Visual Basic .NET Windows Forms application that allows a user to select a drink, flavor, size and quantity and calculates the total cost. It includes code to: 1) Populate two combo boxes with drink and flavor options when the form loads. 2) Clear and populate the flavor combo box differently depending on the selected drink. 3) Calculate the price for each size/drink/flavor combination and display the selected options and total cost on a second form when the user clicks the order button.

Uploaded by

kishi8mempin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Public Class Form1

Private Sub Label3_Click(ByVal sender As [Link], ByVal e As [Link])


Handles [Link]
End Sub
Private Sub Form1_Load(ByVal sender As [Link], ByVal e As [Link])
Handles [Link]
With [Link]
.Add("Coffee")
.Add("Tea")
End With
End Sub
Private Sub cbodrinks_SelectedIndexChanged(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]
If [Link] = 0 Then
With [Link]
.Add("Brewed")
.Add("Iced Coffee")
.Add("Americano")
.Add("Cafe Latte")
.Add("Caramel Macchiato")
End With
End If
If [Link] = 1 Then
With [Link]
.Clear()
.Add("Classic Chai Tea")
.Add("Peach Green Tea")
.Add("Berry Berry Hibiscus")
End With
End If
End Sub
Private Sub cmdorder_Click(ByVal sender As [Link], ByVal e As [Link])
Handles [Link]
Dim Drink, Flavor, Qty, Amount, Total As String
Qty = [Link]
[Link]()
With Form2
.Show()
If [Link] = True Then
[Link] = "Tall"
If [Link] = 0 Then
If [Link] = 0 Then
Amount = 115
ElseIf [Link] = 1 Then
Amount = 145
ElseIf [Link] = 2 Then
Amount = 120
ElseIf [Link] = 3 Then
Amount = 140
Else
Amount = 175
End If
ElseIf [Link] = 1 Then

If [Link] = 0 Then
Amount = 110
ElseIf [Link] = 1 Then
Amount = 140
Else
Amount = 195
End If
End If
ElseIf [Link] = True Then
[Link] = "Grande"
If [Link] = 0 Then
If [Link] = 0 Then
Amount = 130
ElseIf [Link] = 1 Then
Amount = 170
ElseIf [Link] = 2 Then
Amount = 195
ElseIf [Link] = 3 Then
Amount = 165
ElseIf [Link] = 4 Then
Amount = 200
End If
ElseIf [Link] = 1 Then
If [Link] = 0 Then
Amount = 120
ElseIf [Link] = 1 Then
Amount = 160
Else
Amount = 220
End If
End If
ElseIf [Link] = True Then
[Link] = "Venti"
If [Link] = 0 Then
If [Link] = 0 Then
Amount = 145
ElseIf [Link] = 1 Then
Amount = 195
ElseIf [Link] = 2 Then
Amount = 170
ElseIf [Link] = 3 Then
Amount = 190
Else
Amount = 225
End If
ElseIf [Link] = 1 Then
If [Link] = 0 Then
Amount = 135
ElseIf [Link] = 1 Then
Amount = 180
Else
Amount = 225
End If
End If
End If
Drink = [Link]
Flavor = [Link]
Total = Qty * Amount

.[Link] = Drink
.[Link] = Flavor
.[Link] = Qty
.[Link] = Total
End With
End Sub
End Class

You might also like