LIA TUGAS 4

program4

Private Sub Cbogolongan_Click()

Dim gapok, tunjangan, pajak, total As Variant

Select Case Cbogolongan.Text

Case “I”

gapok = 6000000

tunjangan = 600000

Case “II”

gapok = 5000000

tunjangan = 500000

Case “III”

gapok = 9000000

tunjangan = 900000

Case “IV”

gapok = 70000000

tunjangan = 70000000

Case Else

gapok = 0

tunjangan = 0

End Select

total = gapok + tunjangan

pajak = total * 0.1

Txtgapok.Text = gapok

Txttunjangan.Text = tunjangan

Txtpajak.Text = pajak

Txttotal.Text = total – pajak

End Sub

Private Sub Command1_Click()

Txtnidn.SetFocus

Txtnidn.Text = “”

Txtnama.Text = “”

Cbogolongan.Text = “”

Txtgapok.Text = “”

Txttunjangan.Text = “”

Txtpajak.Text = “”

Txttotal.Text = “”

End Sub

Private Sub Command2_Click()

Txtnidn.SetFocus

Txtnidn.Text = “”

Txtnama.Text = “”

Cbogolongan.Text = “”

Txtgapok.Text = “”

Txttunjangan.Text = “”

Txtpajak.Text = “”

Txttotal.Text = “”

End Sub

Private Sub Command3_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

Iklan