Selasa, 28 Mei 2013
Tugas List View Gaji Pegawai VB.net2008
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
nip.Items.Add("123002")
nip.Items.Add("123003")
nip.Items.Add("123004")
gol.Items.Add("IA")
gol.Items.Add("IIA")
gol.Items.Add("IIIA")
Call buattabel()
Lv.BackColor = Color.DarkGreen
End Sub
Sub buattabel()
Lv.GridLines = True
Lv.View = View.Details
Lv.FullRowSelect = True
Lv.Columns.Add("NIP")
Lv.Columns.Add("Nama")
Lv.Columns.Add("Golongan")
Lv.Columns.Add("Gaji")
End Sub
Private Sub masuk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles masuk.Click
Dim lst As New ListViewItem
lst.Text = nip.Text
lst.SubItems.Add(nama.Text)
lst.SubItems.Add(gol.Text)
lst.SubItems.Add(gaji.Text)
Lv.Items.Add(lst)
End Sub
Private Sub hapus_lv_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus_lv.Click
Lv.Items.Clear()
End Sub
Private Sub nip_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nip.SelectedIndexChanged
If nip.Text = "123002" Then
nama.Text = "Adi Prasetia"
ElseIf nip.Text = "123003" Then
nama.Text = "Suzana"
Else
nama.Text = "Panji Setan"
End If
End Sub
Private Sub hapus_isi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus_isi.Click
Lv.Items.Remove(Lv.SelectedItems(0))
End Sub
Private Sub gol_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gol.SelectedIndexChanged
If gol.Text = "IA" Then
gaji.Text = "1500000"
ElseIf gol.Text = "IIA" Then
gaji.Text = "2000000"
Else
gaji.Text = "2500000"
End If
End Sub
Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
End
End Sub
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar