Posted by : Miftahul Baihaqi Annazili May 7, 2016


Kali ini saya akan memberikan contoh bagaimana membuat suatu program sederhana yakni membuat penilaian sederhana dengan vb 6. Karena ini adalah contoh desktop aplication maka saya menggunakan label, textbox, command button, dan frame.
Berikut adalah source code dari program tersebut :

Sub bersih()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub

Private Sub Command1_Click()
Text4.Text = Val(Text1.Text * 0.3) + Val(Text2.Text * 0.3) + Val(Text3.Text * 0.4)
If Val(Text4.Text) >= 85 And Val(Text4.Text) <= 100 Then
    Text5.Text = "A"
    Label7.Caption = "Anda Lulus"
ElseIf Val(Text4.Text) >= 75 And Val(Text4.Text) <= 85 Then
    Text5.Text = "B"
    Label7.Caption = "Anda Lulus"
ElseIf Val(Text4.Text) >= 65 And Val(Text4.Text) < 75 Then
    Text5.Text = "C"
    Label7.Caption = "Anda Lulus"
ElseIf Val(Text4.Text) >= 55 And Val(Text4.Text) < 65 Then
    Text5.Text = "D"
    Label7.Caption = "Tidak Lulus"
ElseIf Val(Text4.Text) >= 0 And Val(Text4.Text) < 55 Then
    Text5.Text = "E"
    Label7.Caption = "Tidak Lulus"
End If
End Sub

Private Sub Command2_Click()
bersih
Text1.SetFocus
End Sub

Private Sub Command3_Click()
konfirmasi = MsgBox("Yakin Mau Keluar???", vbYesNo + vbCritical, "Konfirmasi")
If konfirmasi = vbYes Then
    End
End If
End Sub

Private Sub Form_Load()
bersih
End Sub

Jika teman-teman masih bingung namun ingin mempelajarinya silahkan download >>Disini<<

Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © Java Sae - Hatsune Miku - Powered by Blogger - Designed by Johanes Djogan -