SELANJUTNYA desain sesuai dengan kebutuhan, contohnya seperti gambar ini
LANJUT kodenya seperti ini
KODE TOMBOL PROGRAM KELUAR
Private Sub cmdkeluar_Click()
Unload MeEnd Sub
KODE TOMBOL PROGRAM LAGI
Private Sub cmdlagi_Click()
txtnpm.Text = ""
txtnama.Text = ""
txtabsen.Text = ""
txtkuis.Text = ""
txttugas.Text = ""
txtuts.Text = ""
txtuas.Text = ""
txtnilaiakhir.Text = ""
label2.Caption = ""
txtnpm.SetFocus
End SubKODE TOMBOL PROGRAM PROSES
Private Sub cmdproses_Click()
txtnilaiakhir.Text = (Val(txtabsen.Text) + Val(txtkuis.Text) + Val(txttugas.Text) + Val(txtuts.Text) + Val(txtuas.Text)) / Val(5)
If txtnilaiakhir.Text >= 80 Then
label2.Caption = " A"
ElseIf txtnilaiakhir.Text >= 73 Then
label2.Caption = "B"
ElseIf txtnilaiakhir.Text >= 65 Then
label2.Caption = "C"
Else
label2.Caption = "BL"
End IfEnd Sub
KODE PROGRAM TXT ABSEN
Private Sub txtabsen_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then
txtkuis.SetFocus
End IfEnd Sub
KODE PROGRAM TXT KUIS
Private Sub txtkuis_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then
txttugas.SetFocus
End IfEnd Sub
KODE PROGRAM TXT NAMA
Private Sub txtnama_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then
txtabsen.SetFocus
End IfEnd Sub
KODE PROGRAMTXT NPM
Private Sub txtnpm_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then
txtnama.SetFocus
End IfEnd Sub
KODE PROGRAM TUGAS
Private Sub txttugas_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then
txtuts.SetFocus
End IfEnd Sub
Private Sub txtuts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
ttxtuas.SetFocus
End IfEnd Sub
TERAKHIR... coba jalankan programnya seperti ini
Tidak ada komentar:
Posting Komentar