Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Kode.Items.Add("K001")
Kode.Items.Add("K002")
Kode.Items.Add("K003")
For i =
1 To 10
JumlahBeli.Items.Add(i)
Next
Nama.Enabled = False
Harga.Enabled = False
Call
settable()
End Sub
Private Sub Kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Kode.SelectedIndexChanged
If
Kode.Text = "K001" Then
Nama.Text = "pepsodent"
Harga.Text = 4000
ElseIf
Kode.Text = "K002" Then
Nama.Text = "Rinso"
Harga.Text = 1500
ElseIf
Kode.Text = "K003" Then
Nama.Text = "sabun"
Harga.Text = 2500
End If
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Kembali.Text = Pembayaran.Text -
TotalHarga.Text
End Sub
Private Sub TotalHarga_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
TotalHarga.TextChanged
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Kode.Text = "
"
Nama.Text = "
"
Harga.Text = "
"
JumlahBeli.Text = " "
TotalHarga.Text = " "
Pembayaran.Text = " "
Kembali.Text = "
"
End Sub
Private Sub Button4_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Me.Close()
End Sub
Private Sub Button5_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Lv.Items.Clear()
End Sub
Private Sub Button6_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button6.Click
Lv.Items.Remove(Lv.SelectedItems(0))
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Call
isitable()
End Sub
Sub
settable()
Lv.Columns.Add("Kode",
100, HorizontalAlignment.Left)
Lv.Columns.Add("Nama",
100, HorizontalAlignment.Left)
Lv.Columns.Add("Harga",
100, HorizontalAlignment.Left)
Lv.Columns.Add("JumlahBeli",
100, HorizontalAlignment.Left)
Lv.Columns.Add("TotalHarga",
100, HorizontalAlignment.Left)
Lv.Columns.Add("Pembayaran",
100, HorizontalAlignment.Left)
Lv.Columns.Add("Kembali",
100, HorizontalAlignment.Left)
Lv.View = View.Details
Lv.GridLines = True
Lv.FullRowSelect = True
Kode.Text = "
"
End Sub
Sub
isitable()
Dim x As New ListViewItem
x.Text = Kode.Text
x.SubItems.Add(Nama.Text)
x.SubItems.Add(Harga.Text)
x.SubItems.Add(JumlahBeli.Text)
x.SubItems.Add(TotalHarga.Text)
x.SubItems.Add(Pembayaran.Text)
x.SubItems.Add(Kembali.Text)
Lv.Items.Add(x)
End Sub
Private Sub JumlahBeli_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
JumlahBeli.SelectedIndexChanged
TotalHarga.Text = Harga.Text *
JumlahBeli.Text
End Sub
End Class
Contoh Dasar Program Penjualan Barang
Reviewed by Pak Gulo
on
Februari 23, 2015
Rating:
ahaaaa
BalasHapus