Public Class Form1
Dim listitem As ListViewItem
Dim listtxt(5) As String
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Form1_d(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call bersih()
End Sub
Sub bersih()
TextBox1.Text = " "
TextBox2.Text = " "
TextBox3.Text = " "
TextBox4.Text = " "
TextBox5.Text = " "
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call setlistview()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
listtxt(0) = Trim(TextBox1.Text)
listtxt(1) = Trim(TextBox2.Text)
listtxt(2) = Trim(TextBox3.Text)
listtxt(3) = Trim(TextBox4.Text)
listtxt(4) = Trim(TextBox5.Text)
listitem = New ListViewItem(listtxt)
ListView1.Items.Add(listitem)
End Sub
Sub setlistview()
ListView1.View = View.Details
ListView1.Columns.Add("Nama", 100, HorizontalAlignment.Center)
ListView1.Columns.Add("NPM", 100, HorizontalAlignment.Center)
ListView1.Columns.Add("Alamat", 100, HorizontalAlignment.Center)
ListView1.Columns.Add("Telepon", 100, HorizontalAlignment.Center)
ListView1.Columns.Add("E-mail", 100, HorizontalAlignment.Center)
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
End Class
Tidak ada komentar:
Posting Komentar