Public Class listview
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
isitable()
Dim lst
As New
ListViewItem
lst.Text = npm.Text
lst.SubItems.Add(nama.Text)
LV.Items.Add(lst)
End Sub
Private Sub listview_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
BuatTabel()
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
isitable()
npm.Text = ""
nama.Text = ""
End Sub
Private Sub Button2_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
LV.Items.Clear()
If
LV.SelectedItems.Count <> 0 Then
LV.Items.Remove(LV.SelectedItems(0))
Else
MsgBox("Anda
Yakin Untuk Hapus Semua data")
End If
End Sub
Private Sub Button3_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
End Class
0 komentar:
Posting Komentar