Public Class Form1
Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
buattabel()
kbarang.Items.Add("Ts001")
kbarang.Items.Add("Ts002")
kbarang.Items.Add("VG001")
kbarang.Items.Add("VG002")
End Sub
Sub buattabel()
lv.Columns.Add("No Pembelian", 80, HorizontalAlignment.Center)
lv.Columns.Add("Kode Barang", 80, HorizontalAlignment.Center)
lv.Columns.Add("Nama Barang", 80, HorizontalAlignment.Center)
lv.Columns.Add("Merk", 80, HorizontalAlignment.Center)
lv.Columns.Add("Harga", 80, HorizontalAlignment.Center)
lv.Columns.Add("Jumlah Beli", 80, HorizontalAlignment.Center)
lv.Columns.Add("Total Harga", 80, HorizontalAlignment.Center)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
End Sub
Private Sub btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsimpan.Click
isitabel()
npembelian.Text = ""
kbarang.Text = ""
nbarang.Text = ""
merk.Text = ""
harga.Text = ""
jbeli.Text = ""
tharga.Text = ""
End Sub
Sub isitabel()
Dim lst As New ListViewItem
lst.Text = npembelian.Text
lst.SubItems.Add(kbarang.Text)
lst.SubItems.Add(nbarang.Text)
lst.SubItems.Add(merk.Text)
lst.SubItems.Add(harga.Text)
lst.SubItems.Add(jbeli.Text)
lst.SubItems.Add(tharga.Text)
lv.Items.Add(lst)
End Sub
Private Sub kbarang_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kbarang.SelectedIndexChanged
Select Case kbarang.Text
Case "Ts001" : nbarang.Text = "Flashdisk 4GB"
Case "Ts002" : nbarang.Text = "Flashdisk 2GB"
Case "Vg001" : nbarang.Text = "Flashdisk 4GB"
Case "Vg002" : nbarang.Text = "Flashdisk 2GB"
End Select
Select Case kbarang.Text
Case "Ts001" : merk.Text = "toshiba"
Case "Ts002" : merk.Text = "toshiba"
Case "Vg001" : merk.Text = "V-GEN"
Case "Vg002" : merk.Text = "V-GEN"
End Select
Select Case kbarang.Text
Case "Ts001" : harga.Text = "105000"
Case "Ts002" : harga.Text = "75000"
Case "Vg001" : harga.Text = "90000"
Case "Vg002" : merk.Text = "60000"
End Select
End Sub
Private Sub btnhapussemua_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapussemua.Click
lv.Items.Clear()
End Sub
End Class
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar