TUGAS 2

Untitled

Private Sub cbonpm_Click()
Dim nama, jurusan, hm As String
Select Case cbonpm.Text
Case “09100027”
nama = “MISCHA NURVITA”
jurusan = “Sistem Informasi”
Case “09200048”
nama = “RIO FIRNANDO”
jurusan = “Manajemen Informatika”
Case “09300024”
nama = “DESI ARDILA”
jurusan = “Tehnik Informatika”
End Select
txtnama.Text = nama
txtjurusan.Text = jurusan
txtquis.SetFocus
End Sub

Private Sub cmdbatal_Click()
cbonpm.SetFocus
cbonpm.Text = “”
txtnama.Text = “”
txtjurusan.Text = “”
txtquis.Text = “”
txttugas.Text = “”
txtuts.Text = “”
txtuas.Text = “”
txtna.Text = “”
txthm.Text = “”
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdproses_Click()
Dim na As Integer
Dim hm As String
quis = Val(txtquis.Text)
tugas = Val(txttugas.Text)
uts = Val(txtuts.Text)
uas = Val(txtuas.Text)
na = (quis + tugas + uts + uas) / 4
txtna.Text = na
Select Case txtna.Text
Case Is > 80
hm = “A”
Case Is > 70
hm = “B”
Case Is > 60
hm = “C”
Case Is > 50
hm = “D”
Case Is < 50
hm = “E”
End Select
txthm.Text = hm
End Sub

Private Sub Form_Load()
cbonpm.AddItem “09100027”
cbonpm.AddItem “09200048”
cbonpm.AddItem “09300024”
End Sub

Private Sub txtquis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttugas.SetFocus
End If
End Sub

Private Sub txttugas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtuts.SetFocus
End If
End Sub

Private Sub txtuts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtuas.SetFocus
End If
End Sub

vb

Private Sub chkBold_Click()
If chkBold.Value = 1 Then
IbITeks.FontBold = True
Else
IbITeks.FontBold = False
End If
End Sub

Private Sub chkItalic_Click()
If chkItalic.Value = 1 Then
IbITeks.FontItalic = True
Else
IbITeks.FontItalic = False
End If
End Sub

Private Sub chkStrikeout_Click()
If chkStrikeout.Value = 1 Then
IbITeks.FontStrikethru = True
Else
IbITeks.FontStrikethru = False
End If
End Sub

Private Sub chkUnderline_Click()
If chkUnderline.Value = 1 Then
IbITeks.FontUnderline = True
Else
IbITeks.FontUnderline = False
End If
End Sub

Private Sub cmdExit_Click()
End
End Sub

Private Sub oprGreen_Click()
IbITeks.ForeColor = vbGreen
End Sub

Private Sub optBlue_Click()
IbITeks.ForeColor = vbBlue
End Sub

Private Sub optRed_Click()
IbITeks.ForeColor = vbRed
End Sub

Private Sub optYellow_Click()
IbITeks.ForeColor = vbYellow
End Sub

vb3

Private Sub cbogolongan_Click()
Dim gapok, pajak, tunjangan, total As Variant
Select Case cbogolongan.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
txttotal.Text = total – pajak
End Sub
Public Sub kosong()
txtnidn.SetFocus
txtnidn.Text = “”
txtnama.Text = “”
cbogolongan.Text = “”
txtgapok.Text = “”
txttunjangan.Text = “”
txtpajak.Text = “”
txttotal.Text = “”
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub form_load()
cbogolongan.AddItem “I”
cbogolongan.AddItem “II”
cbogolongan.AddItem “III”
cbogolongan.AddItem “IV”
End Sub

Private Sub cmdbatal_Click()
kosong
End Sub

Private Sub cmdlagi_Click()
kosong
End Sub

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

vb4

Private Sub check1_Click()
Label2.FontBold = check1.Value
End Sub

Private Sub check2_Click()
Label2.FontItalic = check2.Value
End Sub

Private Sub cmdOk_Click()
Label2.Caption = Txt1.Text
End Sub

Private Sub cmdSelesai_Click()
End
End Sub

Private Sub option1_Click(Index As Integer)
Label2.ForeColor = vbBlue
End Sub

Private Sub option2_Click(Index As Integer)
Label2.ForeColor = vbRed
End Sub

Advertisements

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