Welcome To My First Blog

Jumat, 27 Januari 2012

SOAL QUIZ NO 2

LISTING PROGRAM

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        buattabel()

    End Sub

    Sub buattabel()
        Lv.Columns.Add("NPM", 80, HorizontalAlignment.Center)
        Lv.Columns.Add("Nama", 100, HorizontalAlignment.Center)
        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 btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
        Lv.Items.Clear()

    End Sub

    Private Sub btndatadipilih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndatadipilih.Click
        Lv.Items.Remove(Lv.SelectedItems(0))

    End Sub

    Private Sub btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsimpan.Click
        isitabel()
        npm.Text = ""
        nama.Text = ""

    End Sub
End Class

Hasil Program


Tidak ada komentar:

Posting Komentar