Kasus: KLIK DISINI
FORM MENYIMPAN DAN MENGHAPUS DATA DI LIST VIEW
LISTING PROGRAM
FORM MENYIMPAN DAN MENGHAPUS DATA DI LIST VIEW
LISTING PROGRAM
Public Class Form1
Sub
buattabel()
LV.Columns.Add("NPM",
80, HorizontalAlignment.Center)
LV.Columns.Add("NAMA",
160, HorizontalAlignment.Left)
LV.Columns.Add("TAHUN",
80, HorizontalAlignment.Right)
LV.VIEW = View.Details
LV.GRIDLINES = True
LV.FULLROWSELECT = True
End Sub
Sub
ISITABEL()
Dim lst
As New
ListViewItem
lst.Text = NPM.Text
lst.SubItems.Add(nama.Text)
lst.SubItems.Add(tahun.Text)
LV.Items.Add(lst)
End Sub
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
buattabel()
End Sub
Private Sub proses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnproses.Click
ISITABEL()
NPM.Text = ""
nama.Text = ""
tahun.Text = ""
End Sub
Private Sub BTNKELUAR_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BTNKELUAR.Click
Me.Close()
End Sub
Private Sub HAPUSSEMUA_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles HAPUSSEMUA.Click
LV.Items.Clear()
End Sub
Private Sub HAPUS_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles HAPUS.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
End Class
Tidak ada komentar:
Posting Komentar