Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
npm.Text = ("pilih")
npm.Items.Add("0911322")
npm.Items.Add("0741253")
npm.Items.Add("1002040")
npm.Items.Add("1132337")
Call buat_tabel()
End Sub
Sub buat_tabel()
lv.Columns.Add("Npm", 80)
lv.Columns.Add("Nama", 80)
lv.Columns.Add("Jurusan", 80)
lv.Columns.Add("Jenjang", 80)
lv.Columns.Add("Tahun masuk", 80)
lv.Columns.Add("Nilai Angka", 80)
lv.Columns.Add("Nilai Huruf", 80)
lv.View = View.Details
lv.GridLines = True
End Sub
Private Sub npm_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles npm.SelectedIndexChanged
Dim x, y, g As String
x = Microsoft.VisualBasic.Left(npm.Text, 2)
y = Microsoft.VisualBasic.Mid(npm.Text, 3, 1)
g = Microsoft.VisualBasic.Mid(npm.Text, 4, 2)
Select Case x
Case "09" : Me.tahun_masuk.Text = 2009
Case "07" : Me.tahun_masuk.Text = 2007
Case "10" : Me.tahun_masuk.Text = 2010
Case "11" : Me.tahun_masuk.Text = 2011
End Select
If y = "1" Then
jenjang.Text = "S1"
nama.Text = "lailatul husnah"
ElseIf y = "4" Then
jenjang.Text = "Diploma III"
nama.Text = "fatimah zahra"
ElseIf y = "0" Then
jenjang.Text = "Diploma I"
nama.Text = "yudi pembrianto"
ElseIf y = "3" Then
jenjang.Text = "S2"
nama.Text = "diki pramana"
End If
If g = "13" Then
jurusan.Text = "Teknik Informatika"
ElseIf g = "12" Then
jurusan.Text = "Sistem Informasi"
ElseIf g = "20" Then
jurusan.Text = "Akutansi"
ElseIf g = "23" Then
jurusan.Text = "Manajemen Informatika"
End If
End Sub
Private Sub nilai_angka_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles nilai_angka.KeyPress
If Asc(e.KeyChar) = 13 Then
If nilai_angka.Text >= 80 Then
nilai_huruf.Text = "A"
ElseIf nilai_angka.Text >= 75 Then
nilai_huruf.Text = "B+"
ElseIf nilai_angka.Text >= 70 Then
nilai_huruf.Text = "B"
ElseIf nilai_angka.Text >= 65 Then
nilai_huruf.Text = "C+"
ElseIf nilai_angka.Text >= 60 Then
nilai_huruf.Text = "C"
ElseIf nilai_angka.Text < 60 Then
nilai_huruf.Text = "D"
End If
End If
End Sub
Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
End
End Sub
Private Sub hapus_semua_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus_semua.Click
lv.Items.Clear()
End Sub
Private Sub hapus_data_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus_data.Click
lv.Items.Remove(lv.SelectedItems(0))
End Sub
Private Sub simpan_kelisview_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles simpan_kelisview.Click
Dim isi As ListViewItem
isi = lv.Items.Add(npm.Text)
isi.SubItems.Add(nama.Text)
isi.SubItems.Add(jurusan.Text)
isi.SubItems.Add(jenjang.Text)
isi.SubItems.Add(tahun_masuk.Text)
isi.SubItems.Add(nilai_angka.Text)
isi.SubItems.Add(nilai_huruf.Text)
End Sub
Private Sub nbersih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nbersih.Click
npm.Text = ""
nama.Text = ""
jurusan.Text = ""
jenjang.Text = ""
tahun_masuk.Text = ""
nilai_angka.Text = ""
nilai_huruf.Text = ""
End Sub
End Class
INPUT DATA MAHASISWA
HASIL PROGRAM
trima kasih kk artikelnya
BalasHapus