Selasa, 14 November 2017

Tugas 4 penjumlahan Menggunakan Keypress


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_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Text2.SetFocus
End If
End Sub

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

0 komentar:

Posting Komentar