Listing Code :
Private Sub Bersih_Click() Dim kontrol As Control For Each kontrol In Me.Controls If TypeOf kontrol Is TextBox Then kontrol.Text = "" Next End Sub Private Sub Form_Activate() habsen.Enabled = False htugas.Enabled = False huts.Enabled = False huas.Enabled = False txtabsen.SetFocus End Sub Private Sub Hitung_Click() 'Menghitung Total Nilai txttotal = Val(habsen.Text) + Val(htugas.Text) + Val(huts.Text) + Val(huas.Text) 'Menghitung Grade If txttotal >= 80 And txttotal <= 100 Then txtgrade = "A" ElseIf txttotal >= 69 And txttotal <= 79 Then txtgrade = "B" ElseIf txttotal >= 56 And txttotal <= 68 Then txtgrade = "C" ElseIf txttotal >= 40 And txttotal <= 55 Then txtgrade = "D" Else txtgrade = "E" End If 'Menghitung Keterangan If txtgrade = "A" Or txtgrade = "B" Or txtgrade = "C" Then txtket = "LULUS" Else txtket = "GAGAL" End If End Sub Private Sub Keluar_Click() End End Sub Private Sub txtabsen_Change() habsen = 0.1 * Val(txtabsen) End Sub Private Sub txttugas_Change() htugas = 0.2 * Val(txttugas) End Sub Private Sub txtuts_Change() huts = 0.3 * Val(txtuts) End Sub Private Sub txtuas_Change() huas = 0.4 * Val(txtuas) End Sub
0 komentar:
Posting Komentar