tugas 4

TUGAS 1.1 HURUF MUTU MAHASISWA (CLICK)

RAHMAT MUTU

Private Sub cbonpm_click()

Dim nm, jr As String

Select Case cbonpm.Text

Case “14201010”

nm = “SUEB”

jr = “SISTEM INFORMASI”

Case “11100376”

nm = “AGUS”

jr = “MANAJEMEN INFORMATIKA”

Case “14201011”

nm = “SUPRI”

jr = “MANAJEMEN INFORMATIKA”

Case “11100372”

nm = “BEJO”

jr = “MANAJEMEN INFORMATIKA”

Case “14100143”

nm = “NUR ZAINI”

jr = “SISTEM INFORMASI”

Case “14100144”

nm = “RAHMAT”

jr = “MANAJEMEN INFORMATIKA”

Case “14100145”

nm = “RIYAN ALFIANDI”

jr = “SISTEM INFORMASI”

Case “14100111”

nm = “UDIN”

jr = “SISTEM INFORMASI”

Case “14200155”

nm = “BROTO”

jr = “MANAJEMEN INFORMATIKA”

Case “14201022”

nm = “TINEM”

jr = “SISTEM INFORMASI”

End Select

txtnama.Text = nm

txtjur.Text = jr

txtquis.SetFocus

End Sub

 

Private Sub cmd_batal_Click()

txtnama.Text = “”

txtjur.Text = “”

txtquis.Text = “”

txttugas.Text = “”

txtuts.Text = “”

txtuas.Text = “”

txtnilaiakhir.Text = “”

txtmutu.Text = “”

cmbnpm.Text = “”

cmbnpm.SetFocus

 

End Sub

 

Private Sub cmd_keluar_Click()

End

End Sub

 

Private Sub cmd_proses_Click()

txtnilaiakhir.Text = (Val(txtquis.Text) * 0.25 + Val(txttugas.Text) * 0.2 + Val(txtuts.Text) * 0.2 + Val(txtuas.Text) * 0.35)

 

If txtnilaiakhir.Text < 50 Then

txtmutu.Text = “D”

End If

If txtnilaiakhir.Text < 65 And txtnilaiakhir.Text > 49 Then

txtmutu.Text = “C”

End If

If txtnilaiakhir.Text < 80 And txtnilaiakhir.Text > 64 Then

txtmutu.Text = “B”

End If

If txtnilaiakhir.Text > 79 Then

txtmutu.Text = “A”

End If

End Sub

 

Private Sub Form_Activate()

cbonpm.SetFocus

End Sub

 

Private Sub Form_Load()

cbonpm.AddItem “14201010”

cbonpm.AddItem “11100376”

cbonpm.AddItem “14201011”

cbonpm.AddItem “11100372”

cbonpm.AddItem “14100143”

cbonpm.AddItem “14100144”

cbonpm.AddItem “14100145”

cbonpm.AddItem “14100111”

cbonpm.AddItem “14200155”

cbonpm.AddItem “14201022”

End Sub

Private Sub txtnilaiakhir_change()

If txtnilaiakhir.Text < “50” Then

txtmutu.Text = “D”

End If

If txtnilaiakhir.Text < “65” And txtnilaiakhir.Text > “49” Then

txtmutu.Text = “C”

End If

If txtnilaiakhir.Text < “80” And txtnilaiakhir.Text > “64” Then

txtmutu.Text = “B”

End If

If txtnilaiakhir.Text > “79” Then

txtmutu.Text = “A”

End If

End Sub

 

 

TUGAS 1.2 HURUF MUTU MAHASISWA (ENTER)

RAHMAT MUTU

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

Private Sub txtuas_keypress(keyascii As Integer)

If keyascii = 13 Then

txtnilaiakhir.Text = (Val(txtquis.Text) * 0.25 + Val(txttugas.Text) * 0.2 + Val(txtuts.Text) * 0.2 + Val(txtuas.Text) * 0.35)

txtnilaiakhir.SetFocus

End If

End Sub

 

Private Sub txtuts_KeyPress(keyascii As Integer)

If keyascii = 13 Then

txtuas.SetFocus

End If

 

End Sub

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TUGAS 2 GOLONGAN DAN TOTAL TERIMA

nidn

Private Sub cmdbatal_Click()

txtnidn.SetFocus

txtnidn.Text = “”

txtnama.Text = “”

cbogolongan.Text = “”

txtgapok.Text = “”

txttunjangan.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub cmdlagi_Click()

txtnidn.SetFocus

txtnidn.Text = “”

txtnama.Text = “”

cbogolongan.Text = “”

txtgapok.Text = “”

txttunjangan.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub Form_Load()

cbogolongan.AddItem “I”

cbogolongan.AddItem “II”

cbogolongan.AddItem “III”

cbogolongan.AddItem “IV”

End Sub

 

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

 

Private Sub txtnidn_keypress(keyascii As Integer)

If keyascii = 13 Then

txtnama.SetFocus

End If

End Sub

 

 

 

 

TUGAS 3.1 (CLICK)

RAHMAT NAMA NPM

 

Private Sub cmd_batal_Click()

txtnama.Text = “”

txtnpm.Text = “”

txtjur.Text = “”

txtprogram.Text = “”

txttahun.Text = “”

txtno.Text = “”

txtnama.SetFocus

End Sub

 

Private Sub cmd_keluar_Click()

End

End Sub

 

Private Sub cmd_lagi_Click()

txtnama.Text = “”

txtnpm.Text = “”

txtjur.Text = “”

txtprogram.Text = “”

txttahun.Text = “”

txtno.Text = “”

txtnama.SetFocus

End Sub

 

Private Sub cmdproses_Click()

Dim JR, PS As String

txttm.Text = “20” + Left(txtnpm.Text, 2)

txtno.Text = Right(txtnpm.Text, 3)

 

s = Mid(txtnpm.Text, 3, 1)

If s = “1” Then

JR = “SISTEM INFORMASI”

PS = “STRATA SATU”

ElseIf s = “2” Then

PS = “DIPOMA EMPAT”

JR = “TEKHNIK INFORMATIKA”

ElseIf s = “3” Then

JR = “MANAJEMEN INFORMATIKA”

PS = “DIPLOMA TIGA”

ElseIf s = “4” Then

JR = “KOMPUTER AKUNTANSI”

PS = “DIPLOMA DUA”

End If

txtjr = JR

txtps = PS

End Sub

 

 

 

 

 

 

TUGAS 3.2 (ENTER)

RAHMAT NAMA NPM

Private Sub txtnama_KEYPRESS(KEYASCII As Integer)

If KEYASCII = 13 Then

txtnpm.SetFocus

End If

End Sub

 

Private Sub txtnPM_KEYPRESS(KEYASCII As Integer)

If KEYASCII = 13 Then

Dim JR, PS As String

txttm.Text = “20” + Left(txtnpm.Text, 2)

txtno.Text = Right(txtnpm.Text, 3)

 

s = Mid(txtnpm.Text, 3, 1)

If s = “1” Then

JR = “SISTEM INFORMASI”

PS = “STRATA SATU”

ElseIf s = “2” Then

PS = “DIPOMA EMPAT”

JR = “TEKHNIK INFORMATIKA”

ElseIf s = “3” Then

JR = “MANAJEMEN INFORMATIKA”

PS = “DIPLOMA TIGA”

ElseIf s = “4” Then

JR = “KOMPUTER AKUNTANSI”

PS = “DIPLOMA DUA”

End If

txtjr = JR

txtps = PS

End If

End Sub

 

 

 

 

TUGAS 4

ENTRI PENJUALAN

Private Sub Cmdbatal_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtps.Text = “”

TxtTm.Text = “”

Txturut.Text = “”

End Sub

 

 

Private Sub Cbokode_Click()

Dim merk, hs, total As Variant

Select Case Cbokode.Text

Case “Apple MC965 MacBook Air”

merk = “Apple MacBook Air MC965”

hs = 10800000

Case “Apple MC966 MacBook Air ”

merk = “Apple MacBook Air MC966”

hs = 15800000

Case “Apple MC968 MacBook Air”

merk = “Apple MacBook Air MC968”

hs = 9900000

Case “Apple MC969 MacBook Air”

merk = “Apple MacBook Air MC969”

hs = 11900000

Case “Apple MC700 MacBook Pro”

merk = “Apple MacBook Pro MC700”

hs = 12800000

Case “Apple MC721 MacBook Pro”

merk = “Apple MacBook Pro MC721”

hs = 15900000

Case “Apple MC723 MacBook Pro”

merk = “Apple MacBook Pro MC723”

hs = 19300000

Case “Apple MC724 MacBook Pro”

merk = “Apple MacBook Pro MC724”

hs = 13700000

Case “Apple MC311 MacBook Pro”

merk = “Apple MacBook Pro MC311”

hs = 24200000

Case “Apple MC313 MacBook Pro”

merk = “Apple MacBook Pro MC313”

hs = 11900000

Case “Apple MC314 MacBook Pro”

merk = “Apple MacBook Pro MC314”

hs = 14700000

Case “Apple MC318 MacBook Pro”

merk = “Apple MacBook Pro MC318”

hs = 17600000

Case “Apple MC322 MacBook Pro”

merk = “Apple MacBook Pro MC322”

hs = 21300000

Case “Apple MC965 MacBook Air”

merk = “Apple MacBook Air MC965”

hs = 12800000

Case “Apple MC966 MacBook Air”

merk = “Apple MacBook Air MC966”

hs = 15800000

Case Else

gapok = 0

tunjangan = 0

End Select

Txtmerk.Text = merk

TxtHS.Text = hs

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Cmdhitung_Click()

Cbokode.SetFocus

Cbokode.Text = “”

Txtmerk.Text = “”

TxtHS.Text = “”

Txtjj.Text = “”

Txthp.Text = “”

Txtdis.Text = “”

Txttb.Text = “”

 

End Sub

 

Private Sub cmdproses_Click()

Txthp.Text = Val(TxtHS) * Val(Txtjj)

If Txthp.Text > 140000000 Then Txtdis.Text = 0.15 * Val(Txthp)

If Txthp.Text > 135000000 Then Txtdis.Text = 0.1 * Val(Txthp)

If Txthp.Text > 130000000 Then Txtdis.Text = 0.05 * Val(Txthp)

If Txthp.Text > 125000000 Then Txtdis.Text = 0.02 * Val(Txthp)

Txttb.Text = Val(Txthp) – Val(Txtdis)

End Sub

 

Private Sub Form_Load()

Cbokode.AddItem ” Apple MC965 MacBook Air ”

Cbokode.AddItem “Apple MC966 MacBook Air”

Cbokode.AddItem “Apple MC968 MacBook Air”

Cbokode.AddItem “Apple MC969 MacBook Air”

Cbokode.AddItem “Apple MC700 MacBook Pro”

Cbokode.AddItem “Apple MC721 MacBook Pro”

Cbokode.AddItem “Apple MC723 MacBook Pro”

Cbokode.AddItem “Apple MC724 MacBook Pro”

Cbokode.AddItem “Apple MC311 MacBook Pro”

Cbokode.AddItem “Apple MC313 MacBook Pro”

Cbokode.AddItem “Apple MC314 MacBook Pro”

Cbokode.AddItem “Apple MC318 MacBook Pro”

Cbokode.AddItem “Apple MC322 MacBook Pro”

Cbokode.AddItem “Apple MC965 MacBook Air”

Cbokode.AddItem “Apple MC966 MacBook Air”

 

End Sub

 

 

 

 

 

 

 

 

 

 

 

 

 

TUGAS 5

 

Capture

Private Sub cbokode_Click()

Dim jenis, hasat, jumju, hapen, dis, haba As Variant

Select Case cbokode.Text

Case “P205”

jenis = “pentium II 500 mega hz”

hasat = 1500000

Case “P308”

jenis = “pentium III 800 mega hz”

hasat = 2100000

Case “P310”

jenis = “pentium III 1.0 Giga hz”

hasat = 3500000

Case “P415”

jenis = “pentium IV 1.5 Giga hz”

hasat = 4000000

Case “P417”

jenis = “pentium IV 1.7 Giga hz”

hasat = 4200000

Case “P419”

jenis = “pentium IV 1.9 Giga hz”

hasat = 5000000

Case Else

jenis = 0

hasat = 0

End Select

txtjenis.Text = jenis

txthasat.Text = hasat

 

End Sub

 

Private Sub Cmdclose_Click()

End

End Sub

 

Private Sub Cmdlagi_Click()

cbokode.SetFocus

cbokode.Text = “”

txtjenis.Text = “”

txthasat.Text = “”

txtjumju.Text = “”

txthapen.Text = “”

txtdis.Text = “”

txthaba.Text = “”

End Sub

 

Private Sub Cmdproses_Click()

txthapen.Text = Val(txthasat) * Val(txtjumju)

If txthapen.Text > 30000000 Then txtdis.Text = 0.15 * Val(txthapen)

If txthapen.Text > 25000000 Then txtdis.Text = 0.1 * Val(txthapen)

If txthapen.Text > 20000000 Then txtdis.Text = 0.05 * Val(txthapen)

If txthapen.Text > 15000000 Then txtdis.Text = 0.02 * Val(txthapen)

txthaba.Text = Val(txthapen) – Val(txtdis)

End Sub

 

Private Sub Form_Load()

cbokode.AddItem “P205”

cbokode.AddItem “P308”

cbokode.AddItem “P310”

cbokode.AddItem “P415”

cbokode.AddItem “P417”

cbokode.AddItem “P419”

End Sub

 

 

 

 

 

 

 

 

TUGAS 6

Capture

 

Private Sub cmdbatal_Click()

cbokb.Text = “”

txtjb.Text = “”

txtpengarang.Text = “”

txttt.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

cbokb.SetFocus

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

cbokb.Text = “”

txtjb.Text = “”

txtpengarang.Text = “”

txttt.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

cbokb.SetFocus

End Sub

 

Private Sub cmdproses_Click()

Dim a As String

a = Mid(cbokb.Text, 3, 3)

 

If a = “SIM” Then

txtjb.Text = “Sistem Informasi Manajemen”

txtpengarang.Text = “Yati Nur Oktavia”

txtharga.Text = “75900”

End If

If a = “EDP” Then

txtjb.Text = “Elektronic Data Processing”

txtpengarang.Text = “Imam Tarmizi”

txtharga.Text = “62000”

End If

If a = “MNJ” Then

txtjb.Text = “Manajemen”

txtpengarang.Text = “Valentina Mariana Adiwianti”

txtharga.Text = “42000”

End If

If a = “CRD” Then

txtjb.Text = “Corel Draw”

txtpengarang.Text = “Riyan Suhandi”

txtharga.Text = “53000”

End If

If a = “RPL” Then

txtjb.Text = “Rekayasa Perangkat Lunak”

txtpengarang.Text = “Sinta Umpu Singa”

txtharga.Text = “83000”

End If

 

a = Left(cbokb.Text, 1)

If a = “A” Then

txtpenerbit.Text = “Andi Offset Yogyakarta”

End If

a = Left(cbokb.Text, 1)

If a = “I” Then

txtpenerbit.Text = “Indah Surabaya”

End If

a = Left(cbokb.Text, 1)

If a = “S” Then

txtpenerbit.Text = “Salemba Empat”

End If

a = Left(cbokb.Text, 1)

If a = “E” Then

txtpenerbit.Text = “Elek Media Komputindo”

End If

a = Left(cbokb.Text, 1)

If a = “M” Then

txtpenerbit.Text = “Maxicom”

End If

 

a = Right(cbokb.Text, 2)

txttt.Text = “20” + a

End Sub

 

Private Sub Form_activate()

cbokb.SetFocus

End Sub

 

Private Sub txtjt_KEYPRESS(KEYASCII As Integer)

If KEYASCII = 13 Then

txttotalp.Text = Val(txtht.Text) * Val(txtjt.Text)

cmdlagi.SetFocus

End If

End Sub

 

Private Sub Form_Load()

cbokb.AddItem “A-SIM-01”

cbokb.AddItem “I-EDP-02”

cbokb.AddItem “S-MNJ-03”

cbokb.AddItem “E-CRD-04”

cbokb.AddItem “M-RPL-05”

End Sub

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TUGAS 7

PENJUALAN TIKET KRETA API

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

Txtkt.SetFocus

Txtkt.Text = “”

Txtht.Text = “”

Txtjk.Text = “”

Txtjb.Text = “”

Txtjt.Text = “”

Txttotalp.Text = “”

End Sub

 

Private Sub Cmdproses_Click()

Dim S As String

S = Mid(Txtkt.Text, 1, 3)

If S = “BIM” Then

Txtht.Text = 50000

Txtjk.Text = “BIMA”

Txtjb.Text = “16.00”

S = Mid(Txtkt.Text, 1, 3)

ElseIf S = “MUT” Then

Txtht.Text = 23000

Txtjk.Text = “MUTIARA”

Txtjb.Text = “17.00”

S = Mid(Txtkt.Text, 1, 3)

ElseIf S = “EKO” Then

Txtht.Text = 35000

Txtjk.Text = “EKONOMI”

Txtjb.Text = “19.00”

S = Mid(Txtkt.Text, 1, 3)

ElseIf S = “SEN” Then

Txtht.Text = 15000

Txtjk.Text = “SENIA”

Txtjb.Text = “20.00”

End If

 

Txtjt.SetFocus

End Sub

 

 

 

Private Sub Txtjt_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txttotalp.SetFocus

Txttotalp.Text = Val(Txtht) * Val(Txtjt)

 

End If

End Sub

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TUGAS 8

Capture

Private Sub cmdbatal_Click()

cbokb.Text = “”

txtjb.Text = “”

txtpengarang.Text = “”

txttt.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

cbokb.SetFocus

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

cbokb.Text = “”

txtjb.Text = “”

txtpengarang.Text = “”

txttt.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

cbokb.SetFocus

End Sub

 

Private Sub cmdproses_Click()

Dim a As String

a = Left(cbokb.Text, 3)

 

If a = “SIM” Then

txtjb.Text = “Sistem Informasi Manajemen”

txtpengarang.Text = “FADIYA ULFA”

txtharga.Text = “75900”

End If

If a = “EDP” Then

txtjb.Text = “Elektronic Data Processing”

txtpengarang.Text = “NURUL AGUSTINA”

txtharga.Text = “62000”

End If

If a = “MNJ” Then

txtjb.Text = “Manajemen”

txtpengarang.Text = “RIAN HIDAYAT”

txtharga.Text = “42000”

End If

If a = “CDR” Then

txtjb.Text = “Corel Draw”

txtpengarang.Text = “SITI NUR KHOTIMAH”

txtharga.Text = “53000”

End If

If a = “RPL” Then

txtjb.Text = “Rekayasa Perangkat Lunak”

txtpengarang.Text = “WINDA ERLIANTI”

txtharga.Text = “83000”

End If

 

a = Right(cbokb.Text, 1)

If a = “A” Then

txtpenerbit.Text = “Andi Offset Yogyakarta”

End If

a = Right(cbokb.Text, 1)

If a = “I” Then

txtpenerbit.Text = “Indah Surabaya”

End If

a = Right(cbokb.Text, 1)

If a = “S” Then

txtpenerbit.Text = “Salemba Empat”

End If

a = Right(cbokb.Text, 1)

If a = “E” Then

txtpenerbit.Text = “Elek Media Komputindo”

End If

a = Right(cbokb.Text, 1)

If a = “M” Then

txtpenerbit.Text = “Maxicom”

End If

 

a = Mid(cbokb.Text, 5, 2)

txttt.Text = “20” + a

End Sub

 

Private Sub Form_activate()

cbokb.SetFocus

End Sub

 

Private Sub txtjt_KEYPRESS(KEYASCII As Integer)

If KEYASCII = 13 Then

txttotalp.Text = Val(txtht.Text) * Val(txtjt.Text)

cmdlagi.SetFocus

End If

End Sub

 

Private Sub Form_Load()

cbokb.AddItem “SIM-09-A”

cbokb.AddItem “EDP-10-I”

cbokb.AddItem “MNJ-11-S”

cbokb.AddItem “CRD-12-E”

cbokb.AddItem “RPL-13-M”

End Sub

Advertisements

tugas 3

TUGAS 1.1

HARGA DISKON RAHMAT

Private Sub cmdhitung_Click()

Txtdis.Text = Val(txtha) * 0.1

txthak.Text = Val(txtha) – Val(Txtdis)

End Sub

Private Sub cmdulangi_Click()

txtha.SetFocus

txtha.Text = “”

Txtdis.Text = “”

txthak.Text = “”

End Sub

Private Sub cmdquit_Click()

End

End Sub

Private Sub txtha_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtdis.Text = Val(txtha) * 0.1

txthak.Text = Val(txtha) – Val(Txtdis)

End If

End Sub

TUGAS 1.2

HARGA DISKON RAHMAT

Private Sub cmdhitung_Click()

Txtdis.Text = Val(txtha) * 0.1

txthak.Text = Val(txtha) – Val(Txtdis)

End Sub

Private Sub cmdquit_Click()

End

End Sub

Private Sub cmdulangi_Click()

txtha.SetFocus

txtha.Text = “”

Txtdis.Text = “”

txthak.Text = “”

End Sub

Private Sub txtha_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtdis.Text = Val(txtha) * 0.1

txthak.Text = Val(txtha) – Val(Txtdis)

End If

End Sub

TUGAS 2.1

gaji aplikasi

Private Sub cmdkeluar_Click()

End

End Sub

Private Sub Cmdproses_Click()

txtgk.Text = Val(txtgp) + Val(txttun) – Val(txtpot)

txtpjk.Text = Val(txtgk) * 0.1

txtgd.Text = Val(txtgk) – Val(txtpjk)

End Sub

Private Sub cmdulangi_Click()

txtgp.SetFocus

txtgp = “”

txttun = “”

txtpot = “”

txtgk = “”

txtpjk = “”

txtgd = “”

End Sub

Private Sub txtgp_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txttun.SetFocus

End If

End Sub

Private Sub txtpot_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtgk.Text = Val(txtgp) + Val(txttun) – Val(txtpot)

txtpjk.Text = Val(txtgk) * 0.1

txtgd.Text = Val(txtgk) – Val(txtpjk)

End If

End Sub

Private Sub txttun_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtpot.SetFocus

End If

End Sub

TUGAS 2.2

gaji aplikasi

Private Sub cmdkeluar_Click()

End

End Sub

Private Sub Cmdproses_Click()

txtgk.Text = Val(txtgp) + Val(txttun) – Val(txtpot)

txtpjk.Text = Val(txtgk) * 0.1

txtgd.Text = Val(txtgk) – Val(txtpjk)

End Sub

Private Sub cmdulangi_Click()

txtgp.SetFocus

txtgp = “”

txttun = “”

txtpot = “”

txtgk = “”

txtpjk = “”

txtgd = “”

End Sub

Private Sub txtgp_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txttun.SetFocus

End If

End Sub

Private Sub txtpot_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtgk.Text = Val(txtgp) + Val(txttun) – Val(txtpot)

txtpjk.Text = Val(txtgk) * 0.1

txtgd.Text = Val(txtgk) – Val(txtpjk)

End If

End Sub

Private Sub txttun_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtpot.SetFocus

End If

End Sub

TUGAS 3

warna

Private Sub Chkbold_Click()

‘membuat teks berwarna mwrah

If Chkbold.Value = 1 Then

Lblteks.FontBold = True

Else

Lblteks.FontBold = False

End If

End Sub

Private Sub Chkitalic_Click()

‘membuat teks berwarna mwrah

If Chkitalic.Value = 1 Then

Lblteks.FontItalic = True

Else

Lblteks.FontItalic = False

End If

End Sub

Private Sub Chkstrikeout_Click()

‘membuat teks berwarna merah

If Chkstrikeout.Value = 1 Then

Lblteks.Fontstrikeout = True

Else

Lblteks.Fontstrikeout = False

End If

End Sub

Private Sub Chkunderline_Click()

‘membuat teks berwarna merah

If Chkunderline.Value = 1 Then

Lblteks.FontUnderline = True

Else

Lblteks.FontUnderline = False

End If

End Sub

Private Sub Command1_Click()

End

End Sub

Private Sub cmdexit_Click()

End

End Sub

Private Sub optblue_Click()

‘membuat teks berwarna biru

Lblteks.ForeColor = vbBlue

End Sub

Private Sub optgreen_Click()

‘membuat teks berwarna hijau

Lblteks.ForeColor = vbGreen

End Sub

Private Sub optred_Click()

‘membuat teks berwarna merah

Lblteks.ForeColor = vbRed

End Sub

Private Sub optyellow_Click()

‘membuat teks berwarna kuning

Lblteks.ForeColor = vbYellow

End Sub

TUGAS 4

TULISKAN NAMA ANDA RAHMAT

Private Sub chkitalic_Click()

‘membuat teks miring

If chkitalic.Value = 1 Then

lbltext.FontItalic = True

Else

lbltext.FontItalic = False

End If

End Sub

Private Sub cmdok_Click()

lbltext.Text = Val(Text1.Text)

End Sub

Private Sub cmdselesai_Click()

End

End Sub

Private Sub optblue_Click()

‘membuat teks berwarna biru

lbltext.ForeColor = vbBlue

End Sub

Private Sub chkbold_Click()

‘membuat teks tebal

If chkbold.Value = 1 Then

lbltext.FontBold = True

Else

lbltext.FontBold = False

End If

End Sub

Private Sub optred_Click()

‘membuat teks berwarna merah

lbltext.ForeColor = vbRed

End Sub

Private Sub lbltext_Change()

lbltext.Text = Text1.Text

End Sub