Home » Uncategorized » Tugas 4 Visual Basic

Tugas 4 Visual Basic

Download tugas VB 4.exe

Download tugas VB 4b

KODE PROGRAM :

Private Sub cbogol_Click()
Dim gapok, pajak, tunjangan, total As Variant
Select Case cbogol.Text
Case “I”
gapok = 1500000
tunjangan = 150000
Case “II”
gapok = 2000000
tunjangan = 200000
Case “III”
gapok = 2500000
tunjangan = 250000
Case “IV”
gapok = 3000000
tunjangan = 300000
Case Else
gapok = 0
tunjangan = 0
End Select
total = gapok + tunjangan
pajak = total * 0.1
txtgapok.Text = gapok
txttunjangan.Text = tunjangan
txtpajak.Text = pajak
txttot.Text = total – pajak
End Sub

Private Sub Command1_Click()
txtnidn = “”
txtnm = “”
cbogol = “”
txtgapok = “”
txttunjangan = “”
txtpajak = “”
txttot = “”
txtnidn.SetFocus
End Sub

Private Sub Command2_Click()
txtnidn = “”
txtnm = “”
cbogol = “”
txtgapok = “”
txttunjangan = “”
txtpajak = “”
txttot = “”
txtnidn.SetFocus
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Load()
cbogol.AddItem “I”
cbogol.AddItem “II”
cbogol.AddItem “III”
cbogol.AddItem “IV”
End Sub

Private Sub txtnidn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnm.SetFocus
End If
End Sub

KODE PROGRAM :

Private Sub cmdclear_Click()
txt1.Text = “”
txt1.SetFocus
txt1.ForeColor = &H0&
End Sub

Private Sub cmdok_Click()
Dim hasil As Integer
hasil = Val(txt1.Text)
If (chktebal.Value = 1) And (chkmiring.Value = 1) Then
txt1.FontBold = True
txt1.FontItalic = True
End If
If (chktebal.Value = 1) And (chkmiring.Value = 0) Then
txt1.FontBold = True
txt1.FontItalic = False
End If
If (chktebal.Value = 0) And (chkmiring.Value = 0) Then
txt1.FontBold = False
txt1.FontItalic = False
End If
If (chktebal.Value = 0) And (chkmiring.Value = 1) Then
txt1.FontBold = False
txt1.FontItalic = True
End If
End Sub

Private Sub Command1_Click()
End
End Sub

Private Sub Optmerah_Click()
txt1.ForeColor = &HFF&
End Sub

Private Sub Optbiru_Click()
txt1.ForeColor = &HFF0000
End Sub


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

follow on my twitter

Blog Stats

  • 42,490 hits
%d bloggers like this: