Pada form 1 menjelaskan tentang paket menu yang ada di restaurant tersebut dengan detail jenis makanan dan minuman apa. Lalu ada button yang menuju form 2. Pilihan paket disini menggunakan toolbox combo box.
Design Form 1
Pada Form 2, menjelaskan tentang harga paket menu makanan di restaurant tersebut. Disini digunakan lagi combo box untuk memilih menu paket apa yang dibeli, lalu ada jumlah harga, berapa item yang dipesan dan total. Untuk mengetahui totalnya kita gunakan button enter, lalu untuk mengeluarkan messagebox kalau makanan yang dipesan sudah dibayar kita gunakan button detail, dan untuk keluar dari program gunakan close.
Design Form 2
Coding Form 1
Coding Form 2
Source Code Form 1
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.Selected
Select Case ComboBox1.Text
Case 1
TextBox1.Text = "Rice + Grilled Tuna + Mix Vegetables + Orange Juice"
Case 2
TextBox1.Text = "Mashed Potato + Sirloin Steak + Mix Vegetables + Ice Tea"
Case 3
TextBox1.Text = "Spaghetti Carbonara + Garlic Bread + Soft Drink"
End Select
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show()
End Sub
End Class
Source Code Form 2
Public Class Form2
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.Selected
Select Case ComboBox1.Text
Case 1
TextBox1.Text = 75000
Case 2
TextBox1.Text = 95000
Case 3
TextBox1.Text = 80000
End Select
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox3.Text = TextBox1.Text * TextBox2.Text
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MessageBox.Show("Lunas, Terima Kasih", "Detail Pembelian", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
End Class
Hasil Program Saat Running