Minggu, 29 November 2015

Public Class Form2

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lv.Columns.Add("Kode", 50, HorizontalAlignment.Center)
        lv.Columns.Add("Nama", 150, HorizontalAlignment.Left)
        lv.Columns.Add("Tipe", 80, HorizontalAlignment.Left)
        lv.Columns.Add("B.Beban", 80, HorizontalAlignment.Left)
        lv.Columns.Add("Harga", 80, HorizontalAlignment.Left)
        lv.Columns.Add("J.Pemakaian", 100, HorizontalAlignment.Left)
        lv.Columns.Add("T.Tagihan", 80, HorizontalAlignment.Left)
        lv.Columns.Add("Pajak", 80, HorizontalAlignment.Left)
        lv.Columns.Add("Pembayaran", 100, HorizontalAlignment.Left)
        lv.View = View.Details
        lv.GridLines = True
        lv.FullRowSelect = True
        kp.Items.Add("001")
        kp.Items.Add("002")
        kp.Items.Add("003")
        tipe.Items.Add("Toko")
        tipe.Items.Add("Rumah")
        tipe.Items.Add("Swalayan")
        tipe.Items.Add("Pabrik")
    End Sub

    Private Sub kp_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kp.SelectedIndexChanged
        If kp.Text = "001" Then
            nama.Text = "Kaldius Ndruru"
        ElseIf kp.Text = "002" Then
            nama.Text = "Sriwulan"
        ElseIf kp.Text = "003" Then
            nama.Text = "Laia"
        End If
    End Sub

    Private Sub tipe_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tipe.SelectedIndexChanged
        If tipe.Text = "Toko" Then
            bb.Text = 25000
            hrg.Text = 300
        ElseIf tipe.Text = "Rumah" Then
            bb.Text = 15000
            hrg.Text = 100
        ElseIf tipe.Text = "Swalayan" Then
            bb.Text = 10000
            hrg.Text = 200
        ElseIf tipe.Text = "Pabrik" Then
            bb.Text = 250000
            hrg.Text = 500
        End If
    End Sub

    Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
        Dim lst As New ListViewItem
        lst.Text = kp.Text
        lst.SubItems.Add(nama.Text)
        lst.SubItems.Add(tipe.Text)
        lst.SubItems.Add(bb.Text)
        lst.SubItems.Add(hrg.Text)
        lst.SubItems.Add(jp.Text)
        lst.SubItems.Add(tt.Text)
        lst.SubItems.Add(pjk.Text)
        lst.SubItems.Add(pemb.Text)
        lv.Items.Add(lst)
    End Sub

    Private Sub btnhps_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhps.Click
        kp.Text = ""
        nama.Text = ""
        tipe.Text = ""
        bb.Text = ""
        jp.Text = ""
        tt.Text = ""
        pjk.Text = ""
        pemb.Text = ""
        hrg.Text = ""
    End Sub

    Private Sub btnklr_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnklr.Click
        End
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        lv.Items.Clear()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    End Sub

    Private Sub jp_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jp.KeyPress
        If Asc(e.KeyChar) = 13 Then
            Call proses()
        End If
    End Sub
    Sub proses()
        tt.Text = Val(bb.Text) + Val(hrg.Text * jp.Text)
        pjk.Text = 0.01 * tt.Text
        pemb.Text = Val(tt.Text) + Val(pjk.Text)
    End Sub

    Private Sub jp_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jp.TextChanged

    End Sub
End Class

0 komentar:

Posting Komentar

Unordered List

Sample Text

Blog Archive

Diberdayakan oleh Blogger.

Popular Posts

Recent Posts




Text Widget