TIPS DAN TRIK
Awal
Public Class Form2
Sub BuatTabel()
LV.Columns.Add("NPM", 80, HorizontalAlignment.Center)
LV.Columns.Add("NAMA", 180, HorizontalAlignment.Center)
LV.Columns.Add("MATA KULIAH", 180, HorizontalAlignment.Center)
LV.Columns.Add("NILAI UTS", 80, HorizontalAlignment.Center)
LV.Columns.Add("NILAI UAS", 80, 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 lst As New ListViewItem
lst.Text = npm.Text
lst.SubItems.Add(nama.Text)
lst.SubItems.Add(mata_kuliah.Text)
lst.SubItems.Add(uts.Text)
lst.SubItems.Add(uas.Text)
lst.SubItems.Add(na.Text)
lst.SubItems.Add(nh.Text)
LV.Items.Add(lst)
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
npm.Items.Add("13110123")
npm.Items.Add("13110234")
npm.Items.Add("13110345")
npm.Items.Add("13110456")
mata_kuliah.Items.Add("sistem operasi")
mata_kuliah.Items.Add("struktur dan organisasi komputer")
mata_kuliah.Items.Add("Sistem Basis Data")
mata_kuliah.Items.Add("matriks dan transfomasi linier")
mata_kuliah.Items.Add("struktur data")
mata_kuliah.Items.Add("komunikasi data")
mata_kuliah.Items.Add("pemograman visual")
Call BuatTabel()
End Sub
Private Sub NPM_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles npm.SelectedIndexChanged
If npm.Text = ("13110123") Then
nama.Text = "susanti"
ElseIf npm.Text = ("13110234") Then
nama.Text = "yosefha"
ElseIf npm.Text = ("13110345") Then
nama.Text = "SRI HARTATI"
ElseIf npm.Text = ("13110456") Then
nama.Text = "META VALENTINA"
End If
End Sub
Private Sub Proses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
na.Text = (Val(uts.Text) + Val(uas.Text)) / 2
If na.Text = "90" Then
nh.Text = "A"
ElseIf na.Text = "80" Then
nh.Text = "B"
ElseIf na.Text = "70" Then
nh.Text = "C"
ElseIf na.Text = "60" Then
nh.Text = "D"
Else
nh.Text = "E"
End If
End Sub
Private Sub IL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnisitabel.Click
Call IsiTabel()
End Sub
Private Sub HN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
npm.Text = ""
nama.Text = ""
mata_kuliah.Text = ""
uts.Text = ""
uas.Text = ""
na.Text = ""
nh.Text = ""
End Sub
Private Sub HI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapuslist.Click
LV.Items.Clear()
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
Me.Close()
End Sub
Private Sub HD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapusdata.Click
End Sub
Private Sub uas_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uas.TextChanged
End Sub
End Class
Sub BuatTabel()
LV.Columns.Add("NPM", 80, HorizontalAlignment.Center)
LV.Columns.Add("NAMA", 180, HorizontalAlignment.Center)
LV.Columns.Add("MATA KULIAH", 180, HorizontalAlignment.Center)
LV.Columns.Add("NILAI UTS", 80, HorizontalAlignment.Center)
LV.Columns.Add("NILAI UAS", 80, 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 lst As New ListViewItem
lst.Text = npm.Text
lst.SubItems.Add(nama.Text)
lst.SubItems.Add(mata_kuliah.Text)
lst.SubItems.Add(uts.Text)
lst.SubItems.Add(uas.Text)
lst.SubItems.Add(na.Text)
lst.SubItems.Add(nh.Text)
LV.Items.Add(lst)
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
npm.Items.Add("13110123")
npm.Items.Add("13110234")
npm.Items.Add("13110345")
npm.Items.Add("13110456")
mata_kuliah.Items.Add("sistem operasi")
mata_kuliah.Items.Add("struktur dan organisasi komputer")
mata_kuliah.Items.Add("Sistem Basis Data")
mata_kuliah.Items.Add("matriks dan transfomasi linier")
mata_kuliah.Items.Add("struktur data")
mata_kuliah.Items.Add("komunikasi data")
mata_kuliah.Items.Add("pemograman visual")
Call BuatTabel()
End Sub
Private Sub NPM_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles npm.SelectedIndexChanged
If npm.Text = ("13110123") Then
nama.Text = "susanti"
ElseIf npm.Text = ("13110234") Then
nama.Text = "yosefha"
ElseIf npm.Text = ("13110345") Then
nama.Text = "SRI HARTATI"
ElseIf npm.Text = ("13110456") Then
nama.Text = "META VALENTINA"
End If
End Sub
Private Sub Proses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
na.Text = (Val(uts.Text) + Val(uas.Text)) / 2
If na.Text = "90" Then
nh.Text = "A"
ElseIf na.Text = "80" Then
nh.Text = "B"
ElseIf na.Text = "70" Then
nh.Text = "C"
ElseIf na.Text = "60" Then
nh.Text = "D"
Else
nh.Text = "E"
End If
End Sub
Private Sub IL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnisitabel.Click
Call IsiTabel()
End Sub
Private Sub HN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
npm.Text = ""
nama.Text = ""
mata_kuliah.Text = ""
uts.Text = ""
uas.Text = ""
na.Text = ""
nh.Text = ""
End Sub
Private Sub HI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapuslist.Click
LV.Items.Clear()
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
Me.Close()
End Sub
Private Sub HD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapusdata.Click
End Sub
Private Sub uas_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uas.TextChanged
End Sub
End Class
Hasil :
0 komentar:
Posting Komentar