tugas 2


Private Sub cmdhitung_Click()
txttotal = Val(txtnilai1) + Val(txtnilai2)
txtnilai1.SetFocus
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) + Val(txtnilai2)
End If
End Sub

Komentar

Postingan Populer