Tugas 2 Program 4 (Perhitungan Gaji dengan Keypress)







Private Sub Command1_Click()
Text4.Text = Text1.Text + Text2.Text - Text3.Text
Text5.Text = Text4.Text * 0.05
Text6.Text = Text1.Text - Text3.Text
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text1.SetFocus
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_keypress(keyascii As Integer)
If keyascii = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_keypress(keyascii As Integer)
If keyascii = 13 Then
Text3.SetFocus
End If
End Sub

Private Sub Text3_keypress(keyascii As Integer)
If keyascii = 13 Then
Text4.Text = Text1.Text + Text2.Text - Text3.Text
Text5.Text = Text4.Text * 0.05
Text6.Text = Text1.Text - Text3.Text
End If

End Sub

0 komentar: