Design form seperti dibawahgambar dibawah ini
lalu ketikan perintah sesuai perintah dibawah ini
Public Class Form1
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LV.SelectedIndexChanged
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
buatTable()
End Sub
Sub buatTable()
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 BTNSIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNSIMPAN.Click
IsiTable()
NPM.Text = ""
NAMA.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNHAPUS.Click
LV.Items.Clear()
End Sub
Private Sub BTNDATA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNDATA.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
End Class
http:/trianiarista.blogspot.com
http:/mesran.net
No
|
Komponen
|
Properties
|
Value
| |
1
|
Label1
|
name
|
npm
| |
2
|
Label2
|
name
|
nama
| |
3
|
button1
| simpan | ||
| teks | simpan | |||
| 4 | button2 | name teks |
| |
| button3 | name teks |
hapuspilih
hapuspilih | ||
5
| listview |
name
| LV |
lalu ketikan perintah sesuai perintah dibawah ini
Public Class Form1
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LV.SelectedIndexChanged
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
buatTable()
End Sub
Sub buatTable()
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 BTNSIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNSIMPAN.Click
IsiTable()
NPM.Text = ""
NAMA.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNHAPUS.Click
LV.Items.Clear()
End Sub
Private Sub BTNDATA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNDATA.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
End Class
http:/trianiarista.blogspot.com
http:/mesran.net


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id libero non erat fermentum varius eget at elit. Suspendisse vel mattis diam. Ut sed dui in lectus hendrerit interdum nec ac neque. Praesent a metus eget augue lacinia accumsan ullamcorper sit amet tellus.




0 komentar:
Posting Komentar