PENJUMLAHAN MENGGUNAKAN KEYPRESS TUGAS 4


Private Sub Cmdhitung_Click()
Txtjumlah = Val(Txtnilai1) + Val(Txtnilai2) + Val(Txtnilai3)

End Sub

Private Sub Cmdbatal_Click()
Txtnilai1 = ""
Txtnilai2 = ""
Txtnilai3 = ""
Txtjumlah = ""
Txtnilai1.SetFocus

End Sub

Private Sub Cmdkeluar_Click()
Unload Me

End Sub

Private Sub Cmdlagi_Click()
Txtnilai1 = ""
Txtnilai2 = ""
Txtnilai3 = ""
Txtjumlah = ""
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
Txtnilai3.SetFocus
End If

End Sub

Private Sub Txtnilai3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtjumlah = Val(Txtnilai1) + Val(Txtnilai2) + Val(Txtnilai3)
End If

End Sub

Komentar

Postingan populer dari blog ini

STMIK PRINGSEWU GELAR PERLOMBAAN HUT RI KE-72