Public
Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
lv.Columns.Add("No",
30, HorizontalAlignment.Center)
lv.Columns.Add("Kode",
80, HorizontalAlignment.Center)
lv.Columns.Add("Produk",
90, HorizontalAlignment.Left)
lv.Columns.Add("Harga",
90, HorizontalAlignment.Left)
lv.Columns.Add("Jumlah",
70, HorizontalAlignment.Left)
lv.Columns.Add("Total",
80, HorizontalAlignment.Left)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
kode.Items.Add("1")
kode.Items.Add("2")
kode.Items.Add("3")
End Sub
Private Sub kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
kode.SelectedIndexChanged
Select Case kode.Text
Case
"1"
Produk.Text = "TV"
harga.Text = "2000000"
Case
"2"
Produk.Text = "DVD"
harga.Text = "650000"
Case
"3"
Produk.Text = "CD ROOM"
harga.Text = "450000"
Case
Else
Produk.Text = ""
harga.Text = ""
End Select
End Sub
Private Sub PROSES_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles PROSES.Click
total.Text = Val(harga.Text) *
Val(jumlah.Text)
Dim lst
As New
ListViewItem
lst.Text = NO.Text
lst.SubItems.Add(kode.Text)
lst.SubItems.Add(Produk.Text)
lst.SubItems.Add(harga.Text)
lst.SubItems.Add(jumlah.Text)
lst.SubItems.Add(total.Text)
lv.Items.Add(lst)
End Sub
Private Sub Keluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Keluar.Click
End
End Sub
Private Sub Batal_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Batal.Click
NO.Text = ""
kode.Text = ""
Produk.Text = ""
harga.Text = ""
jumlah.Text = ""
total.Text = ""
End Sub
Private Sub HAPUSList_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles HAPUSList.Click
lv.Items.Clear()
End Sub
End
Class
Demikilahlah postingan saya
Nama : putra arya nanda
Tidak ada komentar:
Posting Komentar