Tugas 3.1 Program Gaji
Source Codenya:
Private Sub Cmdbatal_Click()
kosong
End Sub
Private Sub cmdlagi_Click()
kosong
End Sub
Public Sub kosong()
txtnidn.SetFocus
txtnidn.Text = ""
txtnama.Text = ""
cbogolongan.Text = ""
txtgp.Text = ""
txttj.Text = ""
txtpj.Text = ""
txttotal.Text = ""
End Sub
Private Sub cbogolongan_Click()
Dim gapok, pajak, tunjangan, total As Variant
Select Case cbogolongan.Text
Case "I"
gapok = 2000000
tunjangan = 1500000
Case "II"
gapok = 3000000
tunjangan = 2500000
Case "III"
gapok = 4000000
tunjangan = 3500000
Case "IV"
gapok = 5000000
tunjangan = 4500000
Case Else
gapok = 0
tunjangan = 0
End Select
total = gapok + tunjangan
pajak = total * 0.1
txtgp.Text = gapok
txttj.Text = tunjangan
txtpj.Text = pajak
txttotal.Text = total - pajak
End Sub
Private Sub cmdkeluar_Click()
Unload Me
End Sub
Private Sub Form_Load()
cbogolongan.AddItem "I"
cbogolongan.AddItem "II"
cbogolongan.AddItem "III"
cbogolongan.AddItem "IV"
End Sub
Private Sub txtnidn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnama.SetFocus
End If
End Sub
0 komentar:
Posting Komentar