Tugas 4 Penjumlahan Menggunakan Keypress
Berikut Source Codenya:
Private
Sub cmdhitung_Click()
txttotal = Val(txtnilai1) + (txtnilai2)
End Sub
Private
Sub cmdlagi_Click()
txtnilai1 = ""
txtnilai2 = ""
txttotal = ""
txtnilai1.SetFocus
End Sub
Private
Sub cmdkeluar_click()
Unload Me
End Sub
Private
Sub txtnilai1_keypress(keyascii As Integer)
If keyascii = 13 Then
txtnilai2.SetFocus
End If
End Sub
Private
Sub txtnilai2_keypress(keyascii As Integer)
If keyascii = 13 Then
txttotal = Val(txtnilai1) + (txtnilai2)
End If
End Sub
0 komentar:
Posting Komentar