- Listing Program
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- hapus()
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- kode.Items.Add("RAA-001-002")
- kode.Items.Add("RBB-003-004")
- kode.Items.Add("RCC-005-006")
- kode.Items.Add("RDD-007-008")
- tabel()
- nama.Enabled = False
- tipe.Enabled = False
- hargam3.Enabled = False
- biayab.Enabled = False
- totalt.Enabled = False
- pajak.Enabled = False
- pembayaran.Enabled = False
- daerah.Enabled = False
- End Sub
- Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handleskode.SelectedIndexChanged
- Dim xx As String
- xx = Microsoft.VisualBasic.Left(kode.Text, 3)
- If xx = "RAA" Then
- nama.Text = "reza ariansyah"
- ElseIf xx = "RBB" Then
- nama.Text = "Jailamm igaph"
- ElseIf xx = "RCC" Then
- nama.Text = "chanif arvani"
- Else
- nama.Text = "Lya syahfitri"
- End If
- xx = Microsoft.VisualBasic.Right(kode.Text, 3)
- Select Case xx
- Case "002"
- tipe.Text = "PABRICK"
- hargam3.Text = 250
- biayab.Text = 26000
- Case "004"
- tipe.Text = "TOKO"
- hargam3.Text = 260
- biayab.Text = 29000
- Case "006"
- tipe.Text = "RUMAH"
- hargam3.Text = 290
- biayab.Text = 200000
- Case "008"
- tipe.Text = "SWALAYAN"
- hargam3.Text = 220
- biayab.Text = 2000000
- End Select
- xx = Microsoft.VisualBasic.Mid(kode.Text, 5, 3)
- Select Case xx
- Case "001" : daerah.Text = "Medan"
- Case "003" : daerah.Text = "Belawan"
- Case "005" : daerah.Text = "Jakarta"
- Case "007" : daerah.Text = "Jerman"
- Case Else : daerah.Text = "_"
- End Select
- End Sub
- Private Sub TextBox8_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)Handles jumlahp.KeyPress
- If e.KeyChar = Chr(13) Then
- totalt.Text = Val(biayab.Text) + Val(hargam3.Text * jumlahp.Text)
- pajak.Text = 0.01 * totalt.Text
- pembayaran.Text = Val(totalt.Text) + Val(pajak.Text)
- End If
- End Sub
- Sub tabel()
- lv.Columns.Add("KODE PELANGGAN", 80, HorizontalAlignment.Left)
- lv.Columns.Add("NAMA", 80, HorizontalAlignment.Left)
- lv.Columns.Add("TIPE", 80, HorizontalAlignment.Left)
- lv.Columns.Add("HARGA M3", 80, HorizontalAlignment.Left)
- lv.Columns.Add("BIAYA BEBAN", 100, HorizontalAlignment.Left)
- lv.Columns.Add("PEMKAIAN AIR", 100, HorizontalAlignment.Left)
- lv.Columns.Add("TOTAL TAGIHAN", 100, HorizontalAlignment.Left)
- lv.Columns.Add("PAJAK", 80, HorizontalAlignment.Left)
- lv.Columns.Add("PEMBAYARAN", 100, HorizontalAlignment.Left)
- lv.Columns.Add("DAERAH", 80, HorizontalAlignment.Left)
- lv.View = View.Details
- lv.GridLines = True
- lv.FullRowSelect = True
- End Sub
- Sub isitabel()
- Dim lst As New ListViewItem
- lst.Text = kode.Text
- lst.SubItems.Add(nama.Text)
- lst.SubItems.Add(tipe.Text)
- lst.SubItems.Add(hargam3.Text)
- lst.SubItems.Add(biayab.Text)
- lst.SubItems.Add(jumlahp.Text)
- lst.SubItems.Add(totalt.Text)
- lst.SubItems.Add(pajak.Text)
- lst.SubItems.Add(pembayaran.Text)
- lst.SubItems.Add(daerah.Text)
- lv.Items.Add(lst)
- End Sub
- Sub hapus()
- kode.Text = ""
- nama.Text = ""
- tipe.Text = ""
- hargam3.Text = ""
- biayab.Text = ""
- biayab.Text = ""
- totalt.Text = ""
- pajak.Text = ""
- pembayaran.Text = ""
- jumlahp.Text = ""
- daerah.Text = ""
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- isitabel()
- hapus()
- End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- lv.Items.Remove(lv.Items(0))
- End Sub
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
- lv.Items.Remove(lv.Items(0))
- End Sub
- End Class
Home »
visual basic
» pemakaian if else dalam penyelesaian
pemakaian if else dalam penyelesaian
Posted by Unknown
Posted on 02.19
with No comments
Desain Form Seperti Dibawah
0 comments:
Posting Komentar