Tugas 4 Penjumlahan Menggunakan Keypress
1.
Source kode :
Private Sub cmdhitung_Click()
txttotal = Val(txtnilai1) + (txtnilai2)
End Sub
Private Sub cmdkeluar_Click()
Unload Me
End Sub
Private Sub cmdlagi_Click()
txtnilai1 = ""
txtnilai2 = ""
txttotal = ""
txtnilai1.SetFocus
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
Tidak ada komentar:
Posting Komentar