Program 4 Penjumlahan Menggunakan Enter


Tugas P4
Private Sub Cmdhitung_Click()
txtjmlh = Val(Txtn1) + Val(txtn2) + Val(txtn3)
End Sub

Private Sub Cmdbatal_Click()
Txtn1 = ""
txtn2 = ""
txtn3 = ""
txtjmlh = ""
Txtn1.SetFocus
End Sub
  
Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdlagi_Click()
Txtn1 = ""
txtn2 = ""
txtn3 = ""
txtjmlh = ""
Txtn1.SetFocus
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
txtn3.SetFocus
End If
End Sub

Private Sub txtn3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtjmlh = Val(Txtn1) + Val(txtn2) + Val(txtn3) 
End If
End Sub

Komentar

Postingan populer dari blog ini

CARA MEMBUAT AKUN BBM DAN CONTOH

STMIK Pringsewu Laksanakan POSDIKTI Bagi Mahasiswa Baru 2017

Yudisium STMIK PRINGSEWU 2017