Ads 468x60px

Selasa, 14 November 2017

Penjumlahan Mengunakan Keypress

Tugas 4



Private Sub Command1_Click()
If Val(Text1.Text) & Val(Text2.Text) Then
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Text1.SetFocus
End If
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus

End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Text3.SetFocus
End If
End Sub

Tidak ada komentar:

Posting Komentar

 

Sample text

Sample Text

Sample Text

 
Blogger Templates