penjumlahan menggunakan keypress


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

Komentar

Postingan populer dari blog ini

PELANTIKAN BUPATI DAN WAKIL BUPATI PRINGSEWU 2017

tugas 3.7