Laman

Tugas1_4


APLIKASI PENJUMLAHAN
MENGGUNAKAN KEYPRESS


Private Sub cmdhitung_Click()
Txttotal = Val(textn1) + (textn2)
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
Txtn1 = ""
Txtn2 = ""
Txttotal = ""
Txtn1.SetFocus
End Sub

Private Sub Txtn1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtn2.SetFocus
End If

End Sub

Private Sub Txtn2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txttotal = Val(Txtn1) + (Txtn2)
End If
End Sub

Tidak ada komentar:

Posting Komentar