Assalamualaikum para blogger
budiman,,,,,,,,,,,,,,,,,,,
Kali ini, saya akan memberikan tutorial cara
membuat Kasir sederhana dengan VB.Net 2008. Mungkin, program ini
agak jadul. Tapi mungkin bisa dijadikan referensi kamu J
agak jadul. Tapi mungkin bisa dijadikan referensi kamu J
Ok! Tanpa basa-basi lagi silahkan sedot
tutorialnya.....
Langkah 1, yang pastinya kamu punya program
VB.Net 2008
Langkah 2, tool yang harus disiapkan adalah
Tools
|
Name
|
Text
|
Label 1
|
-
|
Nama Barang
|
Label 2
|
-
|
Harga
|
Label 3
|
-
|
Jumlah
|
Labe 4
|
-
|
Bayar
|
Combobox 1
|
brg
|
-
|
TextBox 1
|
hrg
|
-
|
TextBox 2
|
jlh
|
-
|
TextBox 1
|
smw
|
-
|
TextBox 1
|
ttl
|
-
|
TextBox 1
|
byr
|
-
|
TextBox 1
|
blk
|
-
|
Listview 1
|
lv
|
-
|
Button 1
|
Button1
|
Hitung
|
Button 2
|
Button2
|
Total
|
Buton 3
|
Button3
|
Cancel
|
Button 4
|
Button4
|
Reset
|
Button 5
|
Button5
|
Kembali
|
Jika sudah, desainlah programnya kurang lebih
seperti ini.
Langkah 3, pada tool combobox, di properti
bagian item kita beri seperti gambar,
Langkah 4, masukkan coding berikut;
Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
lv.Columns.Add("Nama
Barang", 200, HorizontalAlignment.Center)
lv.Columns.Add("Harga",
150, HorizontalAlignment.Center)
lv.Columns.Add("Jumlah",
80, HorizontalAlignment.Left)
lv.Columns.Add("Total",
100, HorizontalAlignment.Center)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
End Sub
Private Sub brg_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
brg.SelectedIndexChanged
Select Case brg.Text
Case
"Flash Disk 2 Gb"
hrg.Text = 25000
Case
"Flash Disk 4 Gb"
hrg.Text = 55000
Case
"Flash Disk 8 Gb"
hrg.Text = 60000
Case
"HDD Ex 1 Tb"
hrg.Text = 1000000
Case
"HDD Ex 500 Gb"
hrg.Text = 950000
Case
"CD-R"
hrg.Text = 3000
Case
"CD-RW"
hrg.Text = 5000
Case
"Kabel USB Nippon"
hrg.Text = 15000
End Select
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
smw.Text = Val(hrg.Text) *
Val(jlh.Text)
Dim
list As New
ListViewItem
list.Text = brg.Text
list.SubItems.Add(hrg.Text)
list.SubItems.Add(jlh.Text)
list.SubItems.Add(smw.Text)
lv.Items.Add(list)
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim
total As Integer
For i As Integer = 0 To lv.Items.Count - 1
total = total +
lv.Items(i).SubItems(3).Text
Next
ttl.Text = total
End Sub
Private Sub blk_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles blk.TextChanged
End Sub
Private Sub Button5_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
blk.Text = Val(byr.Text) -
Val(ttl.Text)
End Sub
Private Sub Button4_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
lv.Items.Clear()
byr.Text = ""
blk.Text = ""
ttl.Text = ""
brg.Text = ""
hrg.Text = ""
jlh.Text = ""
smw.Text = ""
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
brg.Text = ""
hrg.Text = ""
jlh.Text = ""
smw.Text = ""
End Sub
End Class
Langkah 5,maka hasilnya akan menjadi seperti ini,
Terima kasih sudah membaca artikel Membuat Kasir Sederhana Menggunakan VB.
Net 2008
Selamat belajar...... :) :)
Komentar
Posting Komentar
Pengunjung Yang baik selalu meninggalkan komentar