1 / 6

Object Listview dalam Windows Form.

Object Listview dalam Windows Form. . Arfansyah, M.Kom. Listview. Listview : digunakan untuk menampilkan data yang bentuknya jamak. Public Class Form1 Dim nomor As Integer Sub Bersih() txtNama.Text = "" txtKelas.Text = "" txtPersen.Text = "" End Sub

tracey
Download Presentation

Object Listview dalam Windows Form.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object Listview dalam Windows Form. Arfansyah, M.Kom

  2. Listview • Listview : digunakan untuk menampilkan data yang bentuknya jamak.

  3. Public Class Form1 Dim nomor As Integer Sub Bersih() txtNama.Text = "" txtKelas.Text = "" txtPersen.Text = "" End Sub Sub Tampilkan(ByVal No As Integer) txtNama.Text = LVAbsen.Items(No).SubItems(0).Text txtKelas.Text = LVAbsen.Items(No).SubItems(1).Text txtPersen.Text = LVAbsen.Items(No).SubItems(2).Text End Sub Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load LVAbsen.Columns.Add("Nama", 200, HorizontalAlignment.Left) LVAbsen.Columns.Add("Kelas", 100, HorizontalAlignment.Center) LVAbsen.Columns.Add("Persentase", 120, HorizontalAlignment.Center) End Sub

  4. Private Sub btnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSimpan.Click nomor = LVAbsen.Items.Count LVAbsen.Items.Add(txtNama.Text) LVAbsen.Items(nomor).SubItems.Add(txtKelas.Text) LVAbsen.Items(nomor).SubItems.Add(txtPersen.Text) End Sub Private Sub btnCari_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCari.Click Dim Cari As String Cari = InputBox("Masukkan Nama Mahasiswanya = ", "Masukkan Nama") For a As Integer = 0 To LVAbsen.Items.Count - 1 If LVAbsen.Items(a).SubItems(0).Text.ToUpper = Cari.ToUpper Then Tampilkan(a) Exit Sub End If Next a MessageBox.Show("Data tidak ditemukan ", "Maaf tidak ketemu") End Sub Private Sub btnHapusSemua_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapusSemua.Click LVAbsen.Items.Clear() Bersih() End Sub

  5. Private Sub txtPersen_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtPersen.KeyPress If Not (Char.IsNumber(e.KeyChar) Or Char.IsControl(e.KeyChar)) Then e.Handled = True MessageBox.Show("Masukkan nilai angka 0-100", "Terima Kasih") End If End Sub Private Sub txtPersen_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPersen.TextChanged If Not (Val(txtPersen.Text) >= 0 And Val(txtPersen.Text) <= 100) Then MessageBox.Show("Masukkan nilai angka 0-100", "Terima Kasih") txtPersen.Text = "" End If End Sub End Class

More Related