Tugas 6 Kaltulator Menggunakan Keypress - Media Informasi

Media Informasi

Trend Teknologi dan Informasi jaman now

menu

Selasa, 14 November 2017

Tugas 6 Kaltulator Menggunakan Keypress


Private Sub cmdbatal_Click()
txtn1 = ""
txtn2 = ""
txtn3 = ""
txtn4 = ""
txtn5 = ""
txtn6 = ""
txtn7 = ""
txtn8 = ""
txttotal1 = ""
txttotal2 = ""
txttotal3 = ""
txttotal4 = ""
txtn1.SetFocus
End Sub

Private Sub cmdhitung_Click()
txttotal1 = Val(txtn1) = (txtn2)
txttotal2 = Val(txtn3) / (txtn4)
txttotal3 = Val(txtn5) - (txtn6)
txttotal4 = Val(txtn7) * (txtn8)
End Sub

Private Sub cmdkluar_Click()
Unload Me
End Sub

Private Sub cmdlgi_Click()
txtn1 = ""
txtn2 = ""
txtn3 = ""
txtn4 = ""
txtn5 = ""
txtn6 = ""
txtn7 = ""
txtn8 = ""
txttotal1 = ""
txttotal2 = ""
txttotal3 = ""
txttotal4 = ""
txtn1.SetFocus
End Sub


Private Sub Form_Load()

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn2.SetFocus
End If
End Sub



Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn3.SetFocus
End If
End Sub


Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn4.SetFocus
End If
End Sub



Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn5.SetFocus
End If
End Sub



Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn6.SetFocus
End Sub

Private Sub Text6_Change()
If KeyAscii = 13 Then
txtn7.SetFocus
End Sub



Private Sub Text7_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtn8.SetFocus
End Sub



Private Sub Text8_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal1 = Val(txtn1) = (txtn2)
txttotal2 = Val(txtn3) / (txtn4)
txttotal3 = Val(txtn5) - (txtn6)
txttotal4 = Val(txtn7) * (txtn8)
End If
End Sub

Tidak ada komentar:

Posting Komentar

Post Top Ad

Responsive Ads Here