Private Sub CMDBERSIH_Click()
TXTN1.SetFocus
TXTN1 = ""
TXTN2 = ""
TXTN3 = ""
TXTN4 = ""
TXTN5 = ""
TXTN6 = ""
TXTN7 = ""
TXTN8 = ""
HASIL1 = ""
HASIL2 = ""
HASIL3 = ""
HASIL4 = ""
End Sub
Private Sub CMDHITUNG_Click()
HASIL1 = Val(TXTN1) + Val(TXTN2)
HASIL2 = Val(TXTN3) * Val(TXTN4)
HASIL3 = Val(TXTN5) - Val(TXTN6)
HASIL4 = Val(TXTN7) / Val(TXTN8)
End Sub
Private Sub CMDKELUAR_Click()
Unload Me
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
HASIL1 = Val(TXTN1) + Val(TXTN2)
End If
End Sub
Private Sub TXTN3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTN4.SetFocus
End If
End Sub
Private Sub TXTN4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
HASIL2 = Val(TXTN3) * Val(TXTN4)
End If
End Sub
Private Sub TXTN5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTN6.SetFocus
End If
End Sub
Private Sub TXTN6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
HASIL3 = Val(TXTN5) - Val(TXTN6)
End If
End Sub
Private Sub TXTN7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TXTN8.SetFocus
End If
End Sub
Private Sub TXTN8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
HASIL4 = Val(TXTN7) / Val(TXTN8)
End If
End Sub
No comments:
Post a Comment