Rabu, 18 April 2012

Tugas Pra UTS 1


Tugas Pra UTS 1
Tampilan Awal




Saat Form dijalankan


Listingnya:
Private Sub cmbgol_Click()
If cmbgol.Text = "I" Then
txtjabatan.Text = "Paintry"
txtgapok.Text = 1000000
txttunjab = 200000
txttrans = 0
ElseIf cmbgol.Text = "II" Then
txtjabatan.Text = "Staff"
txtgapok.Text = 1750000
txttunjab = 300000
txttrans = 200000
ElseIf cmbgol.Text = "III" Then
txtjabatan.Text = "Supervisor"
txtgapok.Text = 2250000
txttunjab = 500000
txttrans = 300000
ElseIf cmbgol.Text = "IV" Then
txtjabatan.Text = "Manajer"
txtgapok.Text = 5000000
txttunjab = 700000
txttrans = 500000
Else
txtjabatan.Text = "Direktur"
txtgapok.Text = 10000000
txttunjab = 1000000
txttrans = 1000000
End If
End Sub

Private Sub cmdhitunglagi_Click()
bersih
End Sub

Private Sub cmdkeluar_Click()
X = MsgBox("Tutup Program?", vbYesNo + vbQuestion, "Konfirmasi")
If X = vbYes Then
Unload Me
End If
End Sub

Private Sub Form_Activate()
bersih
txttgl.Text = Date
cmbgol.Text = " - pilih - "
txtnip.Enabled = True
txtnama.Enabled = True
cmbgol.AddItem "I"
cmbgol.AddItem "II"
cmbgol.AddItem "III"
cmbgol.AddItem "IV"
cmbgol.AddItem "V"
txtjabatan.Enabled = True
txtgapok.Enabled = True
txttunjab.Enabled = True
txttrans.Enabled = True
txttunstat.Enabled = False
txtgajiktr.Enabled = True
txtpph.Enabled = True
cmdhitunglagi.Enabled = True
cmdkeluar.Enabled = True
End Sub

Sub aktif()
txtnip.Enabled = True
txtnama.Enabled = True
txtjabatan.Enabled = True
txtgapok.Enabled = True
txttunjab.Enabled = True
txttrans.Enabled = True
txttunstat.Enabled = True
txtgajiktr.Enabled = True
txtpph.Enabled = True
End Sub

Sub nonaktif()
txtnip.Enabled = False
txtnama.Enabled = False
txtjabatan.Enabled = False
txtgapok.Enabled = False
txttunjab.Enabled = False
txttrans.Enabled = False
txttunstat.Enabled = False
txtgajiktr.Enabled = False
txtpph.Enabled = False
End Sub

Private Sub bersih()
txtnip.Text = ""
txtnama.Text = ""
cmbgol.Text = ""
txtjabatan.Text = ""
opt1.Value = 0
opt2.Value = 0
opt3.Value = 0
txtgapok.Text = ""
txttunjab.Text = ""
txttrans.Text = ""
txttunstat.Text = ""
txtgajiktr.Text = ""
txtgajibersih.Text = ""
txtpph.Text = ""
End Sub

Private Sub opt1_Click()
If opt1.Value = True Then
txttunstat.Text = 300000
txtgajiktr.Text = Val(txtgapok.Text) + Val(txttunjab.Text) + Val(txttrans.Text) + Val(txttunstat.Text)
txtpph.Text = 0.1 * txtgajiktr
txtgajibersih.Text = txtgajiktr.Text - txtpph.Text
End If
End Sub

Private Sub opt2_Click()
If opt2.Value = True Then
txttunstat.Text = 0
txtgajiktr.Text = Val(txtgapok.Text) + Val(txttunjab.Text) + Val(txttrans.Text) + Val(txttunstat.Text)
txtpph.Text = 0.1 * txtgajiktr
txtgajibersih.Text = txtgajiktr.Text - txtpph.Text
End If
End Sub

Private Sub opt3_Click()
If opt3.Value = True Then
txttunstat.Text = 100000
txtgajiktr.Text = Val(txtgapok.Text) + Val(txttunjab.Text) + Val(txttrans.Text) + Val(txttunstat.Text)
txtpph.Text = 0.1 * txtgajiktr
txtgajibersih.Text = txtgajiktr.Text - txtpph.Text
End If
End Sub
Saat di input
Saat tombol hitung lagi di klik

Saat tombol keluar di klik

Tidak ada komentar:

Posting Komentar