Membuat Listview Dengan Vb.Net 2008

Program List View Mahasiswa Di VB.Net 2008



Listing Programs >>
Public Class Form1
    Sub jurusan1()
        cmb_jur.Items.Clear()
        With cmb_jur
            .Items.Add("S1/Teknik Informatika")
            .Items.Add("S1/Sistem Informasi")
            .Items.Add("D3/Manajemen Informatika")
            .Items.Add("D3/Komputerisasi Akutansi")
            .Items.Add("D1/Teknisi Komputer")
            .Items.Add("D1/Manajemen Informatika")
            .Items.Add("D1/Design Grafis")
        End With
    End Sub
    Sub kelas1()
        Cmb_kelas.Items.Clear()
        With Cmb_kelas
            .Items.Add("Pagi")
            .Items.Add("Siang")
            .Items.Add("Malam")
        End With
    End Sub
    Sub bersih(ByVal f As Form)
        Dim x As Object
        For Each x In f.Controls
            If TypeOf x Is TextBox Then x.text = ""
            If TypeOf x Is ComboBox Then x.text = ""
        Next
    End Sub
    Sub IsiTabel()
        Dim Lst As New ListViewItem

        Lst.Text = txt_nama.Text
        Lst.SubItems.Add(txt_npm.Text)
        Lst.SubItems.Add(cmb_jur.Text)
        Lst.SubItems.Add(Cmb_kelas.Text)
        If rd_Lk.Checked = True Then
            Lst.SubItems.Add(rd_Lk.Text)
            rd_Pr.Checked = False
        ElseIf rd_Pr.Checked = True Then
            Lst.SubItems.Add(rd_Pr.Text)
            rd_Lk.Checked = False
        End If
        Lv.Items.Add(Lst)
    End Sub
    Private Sub Btn_simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_simpan.Click
        IsiTabel()
    End Sub
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        jurusan1()
        kelas1()

    End Sub
    Private Sub Btn_Lv_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Lv.Click
        Lv.Items.Clear()
    End Sub
    Private Sub Btn_hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_hapus.Click
        Call bersih(Me)
        rd_Lk.Checked = False
        rd_Pr.Checked = False
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Lv.Items.Remove(Lv.SelectedItems(0))

    End Sub
End Class

Thanks Telah Membaca ....

Semoga Bermanfaat :-) :-)


Program Vb.Net 2008 Menggunakan Fungsi Case



Contoh Program Pegawai menggunakan Case awaq ...
heheheheh .....
Listing Programs >>

Public Class form_pegawai
    Dim x, y As String
    Dim a As String
    Dim c As String
    Dim b As MsgBoxResult

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

        For i = 1 To 8
            cmb_nip.Items.Add("10123300" & i)
        Next
    End Sub

    Sub seleksi()
        a = "Pak"
        c = "Gol"
        x = Microsoft.VisualBasic.Right(cmb_nip.Text, 3)
        Select Case x
            Case "001" : Txt_nama.Text = a & " " & "Mesran" : cmb_gol.Items.Add(c & " " & "IVA")
            Case "002" : Txt_nama.Text = a & " " & "Abdul" : cmb_gol.Items.Add(c & " " & "I")
            Case "003" : Txt_nama.Text = a & " " & "Berto" : cmb_gol.Items.Add(c & " " & "I")
            Case "004" : Txt_nama.Text = a & " " & "Paska" : cmb_gol.Items.Add(c & " " & "I")
            Case "005" : Txt_nama.Text = a & " " & "Toni" : cmb_gol.Items.Add(c & " " & "IIIB")
            Case "006" : Txt_nama.Text = a & " " & "Yasir" : cmb_gol.Items.Add(c & " " & "IIIC")
            Case "007" : Txt_nama.Text = a & " " & "Fahmy" : cmb_gol.Items.Add(c & " " & "I")
            Case "008" : Txt_nama.Text = a & " " & "Lambok" : cmb_gol.Items.Add(c & " " & "I")
        End Select
    End Sub
    Private Sub cmb_nip_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_nip.SelectedIndexChanged
        Call bersih()
        Call seleksi()
    End Sub
    Sub bersih()
        cmb_gol.Items.Clear()
        cmb_gol.Text = ""
        cmb_jabatan.Items.Clear()
        cmb_jabatan.Text = ""
        txt_tunjangan.Text = ""
        txt_gaji.Text = ""
    End Sub
    Sub bersih(ByVal f As Form)
        Dim x As Object
        For Each x In f.Controls
            If TypeOf x Is TextBox Then x.text = ""
            If TypeOf x Is ComboBox Then x.text = ""
        Next
    End Sub

    Private Sub Btn_bersih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_bersih.Click
        Call bersih()
        Call bersih(Me)
    End Sub
    Private Sub cmb_gol_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_gol.SelectedIndexChanged
        x = Microsoft.VisualBasic.Right(cmb_gol.Text, 1)
        Select Case x
            Case "A" : txt_gaji.Text = 5000000 : cmb_jabatan.Items.Add("Ketua")
            Case "B" : txt_gaji.Text = 3500000 : cmb_jabatan.Items.Add("PuketI")
            Case "C" : txt_gaji.Text = 2500000 : cmb_jabatan.Items.Add("PuketII")
            Case "I" : txt_gaji.Text = 2000000 : cmb_jabatan.Items.Add("Dosen")
        End Select
    End Sub

    Private Sub cmb_jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_jabatan.SelectedIndexChanged
        y = Microsoft.VisualBasic.Left(cmb_jabatan.Text, 5)
        Select Case y
            Case "Ketua" : txt_tunjangan.Text = 1800000
            Case "Puket" : txt_tunjangan.Text = 1400000
            Case "Dosen" : txt_tunjangan.Text = 1000000
        End Select
    End Sub

    Private Sub Btn_Proses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Proses.Click
        txt_tolgaji.Text = "Rp" & " " & Val(txt_gaji.Text) + Val(txt_tunjangan.Text)
    End Sub

    Private Sub Btn_keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_keluar.Click

        b = MsgBox("Apa anda Yakin keluar dari program ini?", MsgBoxStyle.Question + _
            MsgBoxStyle.YesNo, "Program Pegawai")
        If b = MsgBoxResult.Yes Then
            Close()
        End If
    End Sub

End Class

<> Semoga Dapata Bermanfaat <>


 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2012. Q Hanya Butuh Kesetia'an - All Rights Reserved
Template Modify by Raikage Wahyu
Powered by Blogger