Sabtu, 28 November 2015
Yuk! Belajar Pemograman Visual Basic dot Net Di Mesran.Net
Public Class Form1
Private Sub Form1_Load(...)
lv.Columns.Add("Kode", 80, HorizontalAlignment.Center)
lv.Columns.Add("Nama", 150, HorizontalAlignment.Left)
lv.Columns.Add("Tipe", 100, HorizontalAlignment.Left)
lv.Columns.Add("Beban Biaya", 90, HorizontalAlignment.Left)
lv.Columns.Add("Harga", 90, HorizontalAlignment.Left)
lv.Columns.Add("jumlah Pemakaian", 100, HorizontalAlignment.Left)
lv.Columns.Add("Total tagihan", 150, HorizontalAlignment.Left)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
Kode_p.Items.Add("001")
Kode_p.Items.Add("002")
Kode_p.Items.Add("003")
Tipe.Items.Add("Toko")
Tipe.Items.Add("Swalayan")
Tipe.Items.Add("Rumah")
Tipe.Items.Add("Pabrik")
End Sub
Private Sub Kode_p_SelectedIndexChanged(...)
Select Kode_p.Text
Case "001" : Nama.Text = "Jhoni"
Case "002" : Nama.Text = "Eko"
Case "003" : Nama.Text = "Dian"
End Select
End Sub
Private Sub Tipe_SelectedIndexChanged(...)
Select Case Tipe.Text
Case "Toko"
biaya.Text = "25000"
harga.Text = "300"
Case "Rumah"
biaya.Text = "15000"
harga.Text = "100"
Case "Swalayan"
biaya.Text = "100000"
harga.Text = "200"
Case "Pabrik"
biaya.Text = "250000"
harga.Text = "500"
End Select
End Sub
Private Sub btnproses_Click(...)
total.Text = Val(biaya.Text) + Val(harga.Text) * (jumlah.Text)
pajak.Text = 0.01 * total.Text
pembayaran.Text = Val(total.Text) + Val(pajak.Text)
Dim lst As New ListViewItem
lst.Text = Kode_p.Text
lst.SubItems.Add(Nama.Text)
lst.SubItems.Add(Tipe.Text)
lst.SubItems.Add(biaya.Text)
lst.SubItems.Add(harga.Text)
lst.SubItems.Add(jumlah.Text)
lst.SubItems.Add(total.Text)
lv.Items.Add(lst)
End Sub
Private Sub btnhapus_Click(...)
Kode_p.Text = ""
Nama.Text = ""
Tipe.Text = ""
biaya.Text = ""
harga.Text = ""
jumlah.Text = ""
total.Text = ""
pajak.Text = ""
pembayaran.Text = ""
End Sub
Private Sub jumlah_KeyPress(...)
If Asc(e.KeyChar) = 13 Then
btnproses_Click(sender, e)
End If
End Sub
Private Sub btnkeluar_Click(...)
End
End Sub
Private Sub btnhapuslist_Click(...)
lv.Items.Clear()
End Sub
End Class
Tampilan yang dihasilkan:
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar