Menghapus data Pada Listview
http://www.mesran.blogspot.com/
Class Form1
Sub buattabel()
LV.Columns.Add("NPM", 80, HorizontalAlignment.Center)
LV.Columns.Add("Nama", 180, HorizontalAlignment.Left)
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)
LV.Items.Add(lst)
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
buattabel()
End Sub
Private Sub Btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnproses.Click
isitabel()
NPM.Text = ""
Nama.Text = ""
End Sub
Private Sub Btnhapussemua_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapussemua.Click
LV.Items.Clear()
End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
End Class
Komentar
Posting Komentar