Public Class listview
Private Sub LV_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")
NIP.Items.Add("123005")
NIP.Items.Add("123006")
NIP.Items.Add("123007")
NIP.Items.Add("123008")
Gol.Items.Add("IA")
Gol.Items.Add("IIA")
Gol.Items.Add("IIIA")
Call BUAT_TABEL()
End Sub
Sub BUAT_TABEL()
LV.GridLines = True
LV.View = View.Details
LV.FullRowSelect = True
LV.Columns.Add("NIP")
LV.Columns.Add("Nama")
LV.Columns.Add("Gol")
LV.Columns.Add("Gaji")
End Sub
Private Sub btnmasuk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmasuk.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 btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.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"
ElseIf NIP.Text = 123003 Then
Nama.Text = "eko"
ElseIf NIP.Text = 123004 Then
Nama.Text = "nina"
ElseIf NIP.Text = 123005 Then
Nama.Text = "dina"
ElseIf NIP.Text = 123006 Then
Nama.Text = "tina"
ElseIf NIP.Text = 123007 Then
Nama.Text = "mera"
ElseIf NIP.Text = 123008 Then
Nama.Text = "fatimah"
End If
End Sub
Private Sub BtnhapusI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnhapusI.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
End
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 = "500000"
ElseIf Gol.Text = "IIA" Then
Gaji.Text = "4000000"
ElseIf Gol.Text = "IIIA" Then
Gaji.Text = "8000000"
End If
End Sub
End Class
Tidak ada komentar:
Posting Komentar