Tugas 4 Visual 1

Buatlah projek seperti gambar di bawah ini. Simpan projek dengan nama “tugas4″ di folder Tugas 4, kemudian simpan form dengan nama”penjualan” di folder yang sama.

KODE PROGRAM

Private Sub Combo1_CLICK()

If Combo1.Text = “Kopi” Then

Text1.Text = 7000

ElseIf Combo1.Text = “Teh” Then

Text1.Text = 5000

ElseIf Combo1.Text = “Susu” Then

Text1.Text = 8000

ElseIf Combo1.Text = “Jamu” Then

Text1.Text = 6500

Else

MsgBox (” silahkan Pilih Pesanan terlebih dahulu”)

End If

End Sub

 

Private Sub Command1_Click()

List1.AddItem (Combo1.Text + ”                   ” + Text1.Text)

Text2.Text = Val(Text2.Text) + Val(Text1.Text)

Combo1.Text = “”

Text1.Text = “”

Text3.SetFocus

End Sub

 

Private Sub Command3_Click()

List1.Clear

List1.AddItem (“PESANAN ” + ”    ” + ” HARGA “)

Text2.Text = 0

Text3.Text = “”

Text4.Text = “”

End Sub

 

Private Sub Form_Load()

List1.AddItem (“PESANAN ” + ”    ” + ” HARGA “)

Combo1.AddItem (“Kopi”)

Combo1.AddItem (“Teh”)

Combo1.AddItem (“Susu”)

Combo1.AddItem (“Jamu”)

Text2.Text = 0

End Sub

Private Sub command2_click()

End

End Sub

Private Sub Text3_Change()

Text4.Text = Val(Text3.Text) – Val(Text2.Text)

End Sub

Print Friendly, PDF & Email