- Membuat Desain seperti dibawah ini!!!
- Public Class Form1Sub isitabel()Dim lst As New ListViewItemlst.Text = NIK.Textlst.SubItems.Add(Nama.Text)lst.SubItems.Add(Jabatan.Text)lst.SubItems.Add(Gaji.Text)lst.SubItems.Add(Status.Text)lst.SubItems.Add(Tunjangan.Text)lst.SubItems.Add(Pajak.Text)lst.SubItems.Add(Total.Text)Lv.Items.Add(lst)End SubSub BuatTabel()LV.Columns.Add("NIK", 50, HorizontalAlignment.Center)LV.Columns.Add("Nama", 100, HorizontalAlignment.Left)LV.Columns.Add("Jabatan", 100, HorizontalAlignment.Left)LV.Columns.Add("Gaji", 80, HorizontalAlignment.Left)LV.Columns.Add("Status", 80, HorizontalAlignment.Left)LV.Columns.Add("Tunjangan", 80, HorizontalAlignment.Left)LV.Columns.Add("Pajak", 180, HorizontalAlignment.Left)LV.Columns.Add("Total Gaji", 180, HorizontalAlignment.Left)LV.View = View.DetailsLV.GridLines = TrueLV.FullRowSelect = TrueEnd SubPrivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadBuatTabel()NIK.Items.Add("001")NIK.Items.Add("002")NIK.Items.Add("003")Jabatan.Items.Add("Mandor")Jabatan.Items.Add("Kepala Bagian")Jabatan.Items.Add("Staf")Status.Items.Add("Menikah")Status.Items.Add("Tidak Menikah")End SubPrivate Sub Jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jabatan.SelectedIndexChangedSelect Case Jabatan.TextCase "Mandor" : Gaji.Text = 1750000Case "Kepala Bagian" : Gaji.Text = 2500000Case "Staf" : Gaji.Text = 1250000End SelectPajak.Text = 0.15 * Gaji.TextEnd SubPrivate Sub NIK_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NIK.SelectedIndexChangedSelect Case NIK.TextCase "001" : Nama.Text = "ISWAHYUNI"Case "002" : Nama.Text = "UDIN"Case "003" : Nama.Text = "UJANG"End SelectEnd SubPrivate Sub Status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Status.SelectedIndexChangedSelect Case Status.TextCase "Menikah" : Tunjangan.Text = 0.15 * Gaji.TextCase "Tidak Menikah" : Tunjangan.Text = 0End SelectEnd SubPrivate Sub Btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnproses.ClickTotal.Text = Val(Gaji.Text) + Val(Tunjangan.Text) - Val(Pajak.Text)End SubPrivate Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.ClickEndEnd SubPrivate Sub Btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnsimpan.Clickisitabel()NIK.Text = ""Nama.Text = ""Jabatan.Text = ""Gaji.Text = ""Status.Text = ""Tunjangan.Text = ""Pajak.Text = ""Total.Text = ""End SubPrivate Sub Btnhapusdata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapusdata.ClickLV.Items.Remove(LV.SelectedItems(0))End SubPrivate Sub Btnhapussemua_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapussemua.ClickLV.Items.Clear()End SubEnd Class
Selasa, 14 Mei 2013
Tugas Bahasa Pemrograman
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar