KALKULATOR MENGGUNAKAN ENTER TUGAS 6


Private Sub txt1_Change()
Txtn1 = ""
Txtn2 = ""
txtn3 = ""
Txtn4 = ""
txtn5 = ""
txtn6 = ""
txtn7 = ""
txtn8 = ""
Txtjmlh1 = ""
txtjmlh2 = ""
txtjmlh3 = ""
txtjmlh4 = ""
Txtjmlh = ""
End Sub

Private Sub Cmdbatal_Click()
Txtn1 = ""
Txtn2 = ""
txtn3 = ""
Txtn4 = ""
txtn5 = ""
txtn6 = ""
txtn7 = ""
txtn8 = ""
Txtjmlh1 = ""
txtjmlh2 = ""
txtjmlh3 = ""
txtjmlh4 = ""
Txtjmlh = ""
End Sub

Private Sub Cmdhitung_Click()
Txtjmlh1 = Val(Txtn1) + Val(Txtn2)
txtjmlh2 = Val(txtn3) - Val(Txtn4)
txtjmlh3 = Val(txtn5): Val (txtn6)
txtjmlh4 = Val(txtn7) * Val(txtn8)
Txtjmlh = Val(Txtjmlh1) + Val(txtjmlh2) + Val(txtjmlh3) + Val(txtjmlh4)
End Sub


Private Sub cmdjumlah_Click()
Txtjmlh1 = Val(Txtn1) + Val(Txtn2)
txtjmlh2 = Val(txtn3) - Val(Txtn4)
txtjmlh3 = Val(txtn5): Val (txtn6)
txtjmlh4 = Val(txtn7) * Val(txtn8)
Txtjmlh = Val(Txtjmlh1) + Val(txtjmlh2) + Val(txtjmlh3) + Val(txtjmlh4)
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdlagi_Click()
Txtn1 = ""
Txtn2 = ""
txtn3 = ""
Txtn4 = ""
txtn5 = ""
txtn6 = ""
txtn7 = ""
txtn8 = ""
Txtjmlh1 = ""
txtjmlh2 = ""
txtjmlh3 = ""
txtjmlh4 = ""
Txtjmlh = ""
End Sub

Private Sub Command10_Click()
Txtjmlh = Val(Txtjmlh1) + Val(txtjmlh2) + Val(txtjmlh3) + Val(txtjmlh4)
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
Txtjmlh1 = Val(Txtn1) + Val(Txtn2)
txtn3.SetFocus
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
txtjmlh2 = Val(txtn3) - Val(Txtn4)
txtn5.SetFocus
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
txtjmlh3 = Val(txtn5) / Val(txtn6)
txtn7.SetFocus
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

txtjmlh4 = Val(txtn7) * Val(txtn8)
End If
End Sub
Private Sub txtnjmlh1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then

Txtjmlh = Val(Txtjmlh1) + Val(txtjmlh2) + Val(txtjmlh3) + Val(txtjmlh4)

End If
End Sub

Komentar

Postingan populer dari blog ini

STMIK PRINGSEWU DAN PEMDA PRINGSEWU MEMBERIKAN PEMBEKALAN KEPADA MAHASISWA KKN

Layar Fleksibel Sudah Dibuat, Kini Lihat Nih Kamera Fleksibel!

YUDISIUM PERIODE I TAHUN 2017