HASIL PERHITUNGAN DAPAT KELUAR DENGAN
MENEKAN TOMBO COMMAND HITUNG DAN KEYPRESS (TOMBOL ENTER)
source code:
Private Sub cmdhitung_Click()
txt3 = Val(txt1) + Val(txt2)
txt6 = Val(txt4) / Val(txt5)
txt9 = Val(txt7) - Val(txt8)
txt12 = Val(txt10) * Val(txt11)
End Sub
Private Sub cmdbatal_Click()
txt1 = ""
txt2 = ""
txt3 = ""
txt4 = ""
txt5 = ""
txt6 = ""
txt7 = ""
txt8 = ""
txt9 = ""
txt10 = ""
txt11 = ""
txt12 = ""
txt1.SetFocus
End Sub
Private Sub cmdlagi_Click()
txt1 = ""
txt2 = ""
txt3 = ""
txt4 = ""
txt5 = ""
txt6 = ""
txt7 = ""
txt8 = ""
txt9 = ""
txt10 = ""
txt11 = ""
txt12 = ""
txt1.SetFocus
End Sub
Private Sub cmdkeluar_Click()
Unload Me
End Sub
Private Sub
txt1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt2.SetFocus
End If
End Sub
Private Sub txt2_KeyPress(KeyAscii
As Integer)
If KeyAscii = 13 Then
txt4.SetFocus
End If
End Sub
Private Sub
txt4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt5.SetFocus
End If
End Sub
Private Sub
txt5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt7.SetFocus
End If
End Sub
Private Sub
txt7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt8.SetFocus
End If
End Sub
Private Sub
txt8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt10.SetFocus
End If
End Sub
Private Sub
txt10_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt11.SetFocus
End If
End Sub
Private Sub
txt11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt3 = Val(txt1) + Val(txt2)
txt6 = Val(txt4) / Val(txt5)
txt9 = Val(txt7) - Val(txt8)
txt12 = Val(txt10) * Val(txt11)
End If
End Sub
Tidak ada komentar:
Posting Komentar