Public Class Form1
Sub buattabel()
lv.Columns.Add("NPM", 80, HorizontalAlignment.Center)
lv.Columns.Add("Nama", 170, HorizontalAlignment.Center)
lv.Columns.Add("Jurusan", , HorizontalAlignment.Center)
lv.Columns.Add("Jenjang", 100, HorizontalAlignment.Center)
lv.Columns.Add("Tahun Masuk", 70, HorizontalAlignment.Center)
lv.Columns.Add("Nilai Angka", 80, HorizontalAlignment.Center)
lv.Columns.Add("Nilai Huruf", 80, HorizontalAlignment.Center)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
End Sub
Sub isitabel()
Dim ist As New ListViewItem
With ist
.Text = npm.Text
.SubItems.Add(nama.Text)
.SubItems.Add(jurusan.Text)
.SubItems.Add(jenjang.Text)
.SubItems.Add(tmasuk.Text)
.SubItems.Add(nangka.Text)
.SubItems.Add(nhuruf.Text)
lv.Items.Add(ist)
End With
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
buattabel()
End Sub
Private Sub npm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles npm.KeyPress
If e.KeyChar = Chr(13) Then
nama.Focus()
End If
End Sub
Private Sub npm_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles npm.TextChanged
Dim x, y As String
x = Microsoft.VisualBasic.Mid(npm.Text, 3, 1)
y = Microsoft.VisualBasic.Mid(npm.Text, 4, 1)
tmasuk.Text = "20" & Microsoft.VisualBasic.Left(npm.Text, 2)
If x = "0" Then
If y = "2" Then
jenjang.Text = "D-3"
jurusan.Text = "Manajemen Informatika"
End If
ElseIf x = "1" Then
jenjang.Text = "S-1"
If x = "1" Then
jurusan.Text = "Sistem Informasi"
ElseIf y = "2" Then
jurusan.Text = "Teknik Informatika"
End If
End If
End Sub
Private Sub btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsimpan.Click
isitabel()
npm.Text = ""
nama.Text = ""
jenjang.Text = ""
jurusan.Text = ""
tmasuk.Text = ""
nangka.Text = ""
nhuruf.Text = ""
End Sub
Sub bersih()
NPM.Text = ""
Nama.Text = ""
Jenjang.Text = ""
jurusan.Text = ""
tmasuk.Text = ""
nangka.Text = ""
nhuruf.Text = ""
End Sub
Private Sub nangka_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles nangka.KeyPress
If e.KeyChar = Chr(13) Then
If nangka.Text >= 90 Then
nhuruf.Text = "A"
ElseIf nangka.Text >= 75 Then
nhuruf.Text = "B"
ElseIf nangka.Text >= 60 Then
nhuruf.Text = "C"
ElseIf nangka.Text >= 50 Then
nhuruf.Text = "D"
Else
nhuruf.Text = "E"
End If
End If
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
npm.Text = ""
nama.Text = ""
jenjang.Text = ""
jurusan.Text = ""
tmasuk.Text = ""
nangka.Text = ""
nhuruf.Text = ""
End Sub
Private Sub btnbersih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbersih.Click
bersih()
End Sub
Private Sub btnhapuspilih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapuspilih.Click
lv.Items.Remove(lv.SelectedItems(0))
End Sub
Private Sub nangka_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nangka.TextChanged
End Sub
End Class
Tidak ada komentar:
Posting Komentar