0% found this document useful (0 votes)
46 views2 pages

Makanan dan Minuman Harga Form

This document contains code for a form that allows a user to select a food and drink item from dropdown menus. It calculates the price of the selected items and displays the total. The form has dropdowns for selecting a main dish and drink. Based on the selection, it sets the price variables and displays the individual item price. When the user clicks the button, it calculates the total by multiplying the quantity of each item by the price and adding them together.

Uploaded by

chaca
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)
46 views2 pages

Makanan dan Minuman Harga Form

This document contains code for a form that allows a user to select a food and drink item from dropdown menus. It calculates the price of the selected items and displays the total. The form has dropdowns for selecting a main dish and drink. Based on the selection, it sets the price variables and displays the individual item price. When the user clicks the button, it calculates the total by multiplying the quantity of each item by the price and adding them together.

Uploaded by

chaca
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 Form2

Public hargamakanan, hargaminuman As Integer

Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub

Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles


ComboBox1.SelectedIndexChanged
Select Case ComboBox1.Text
Case "nasi uduk"
Label3.Text = "rp.3500"
hargamakanan = 3500
Case "bakso"
Label3.Text = "rp.6000"
hargamakanan = 6000
Case "mie ayam"
Label3.Text = "rp.7000"
hargamakanan = 7000
End Select
End Sub

Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles


ComboBox2.SelectedIndexChanged
Select Case ComboBox2.Text
Case "es jeruk"
Label3.Text = "rp.3000"
hargaminuman = 3500
Case "jus alpukat"
Label3.Text = "rp.7000"
hargaminuman = 6000
Case "teh manis"
Label3.Text = "rp.4000"
hargaminuman = 7000
End Select
End Sub
Public Sub New()

' This call is required by the designer.


InitializeComponent()
ComboBox2.Visible = False
Label2.Visible = False
' Add any initialization after the InitializeComponent() call.

End Sub

Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles


CheckBox1.CheckedChanged
If CheckBox1.Enabled = False Then
ComboBox2.Visible = False
End If
If ComboBox1.Enabled = True Then
ComboBox2.Visible = True
Label2.Visible = True
End If
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


Dim porsimkn, porsiminum, jumlah As Integer
porsimkn = TextBox1.Text
porsiminum = TextBox2.Text
jumlah = (hargamakanan * porsimkn) + (hargaminuman * porsiminum)
Label7.Text = "rp." & jumlah.ToString
End Sub
End Class

You might also like