Public Class Form1
Sub bersih()
kode.Text = ""
nama.Text = ""
satuan.Text = ""
harga.Text = ""
jumlah.Text = ""
jbeli.Text = ""
hbeli.Text = ""
diskon.Text = ""
hbersih.Text = ""
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
Me.Close()
End Sub
Private Sub btnbatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbatal.Click
Call bersih()
End Sub
Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
hbeli.Text = Val(harga.Text) * Val(jbeli.Text)
If Val(jbeli.Text) >= 5 Then
diskon.Text = 0.05 * Val(hbeli.Text)
ElseIf Val(jbeli.Text) >= 3 Then
diskon.Text = 0.04 * Val(hbeli.Text)
Else
diskon.Text = 0
End If
hbersih.Text = Val(hbeli.Text) - Val(diskon.Text)
Call isitable()
End Sub
Sub isitable()
Dim bg As New ListViewItem
bg.Text = kode.Text
bg.SubItems.Add(nama.Text)
bg.SubItems.Add(satuan.Text)
bg.SubItems.Add(harga.Text)
bg.SubItems.Add(jumlah.Text)
bg.SubItems.Add(jbeli.Text)
bg.SubItems.Add(hbeli.Text)
bg.SubItems.Add(diskon.Text)
bg.SubItems.Add(hbersih.Text)
lv.Items.Add(bg)
End Sub
End Class
CONTOH PEMBUATAN PROGRAM FORM PENJUALAN BARANG DENGAN VB 2008
Reviewed by Pak Gulo
on
Maret 25, 2015
Rating:
Tidak ada komentar: