tugas vb 1-9

diskon

Option Explicit

Private Sub CMDQU_Click()

End

End Sub

Private Sub CMDUL_Click()

TXTHA = “”

TXTDIS = “”

TXTAKH = “”

End Sub

Private Sub TXTHA_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTDIS.Text = Val(TXTHA.Text) * 0.1

TXTAKH.Text = Val(TXTHA.Text) – Val(TXTDIS.Text)

End If

End Sub

diskon

Option Explicit

Private Sub CMDQU_Click()

End

End Sub

Private Sub CMDUL_Click()

TXTHA = “”

TXTDIS = “”

TXTAKH = “”

End Sub

Private Sub TXTHA_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTDIS.Text = Val(TXTHA.Text) * 0.1

TXTAKH.Text = Val(TXTHA.Text) – Val(TXTDIS.Text)

End If

End Sub

diskon

Private Sub CMDHT_Click()

TXTDIS.Text = Val(TXTHA.Text) * 0.1

TXTAKH.Text = Val(TXTHA.Text) – Val(TXTDIS.Text)

End Sub

Private Sub CMDQU_Click()

End

End Sub

Private Sub CMDUL_Click()

TXTHA.SetFocus

TXTHA = “”

TXTDIS = “”

TXTAKH = “”

End Sub

pehitungan gaji

Option Explicit

Private Sub CMDPROSES_Click()

TXTGK.Text = Val(TXTGP.Text) + Val(TXTTJ.Text) – Val(TXTPT.Text)

TXTPJ.Text = Val(TXTGK.Text) * (0.1)

TXTGB.Text = Val(TXTGK.Text) – Val(TXTPJ.Text)

End Sub

Private Sub CMDQUIT_Click()

End

End Sub

Private Sub CMDULANG_Click()

TXTGP.SetFocus

TXTGP = “”

TXTTJ = “”

TXTPT = “”

TXTGK = “”

TXTPJ = “”

TXTGB = “”

End Sub

Private Sub TXTGP_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTTJ.SetFocus

End If

End Sub

Private Sub TXTTJ_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTPT.SetFocus

End If

End Sub

worno

Option Explicit

Private Sub Check1_Click()

If Check1.Value = 1 Then

Label1.FontBold = True

Else

Label1.FontBold = False

End If

End Sub

Private Sub Check2_Click()

If Check2.Value = 1 Then

Label1.FontItalic = True

Else

Label1.FontItalic = False

End If

End Sub

Private Sub Check3_Click()

If Check3.Value = 1 Then

Label1.FontUnderline = True

Else

Label1.FontUnderline = False

End If

End Sub

Private Sub Check4_Click()

If Check4.Value = 1 Then

Label1.FontStrikethru = True

Else

Label1.FontStrikethru = False

End If

End Sub

Private Sub Command1_Click()

End

End Sub

Private Sub Option1_Click()

Label1.ForeColor = vbRed

End Sub

Private Sub Option2_Click()

Label1.ForeColor = vbYellow

End Sub

Private Sub Option3_Click()

Label1.ForeColor = vbGreen

End Sub

Private Sub Option4_Click()

Label1.ForeColor = vbBlue

End Sub

npm angel

Option Explicit

Private Sub Combatal_Click()

Txtnama.SetFocus

Txtnama.Text = “”

TXTNPM.Text = “”

Txtjurusan.Text = “”

TXTPS.Text = “”

TXTTHM.Text = “”

Txturut.Text = “”

End Sub

Private Sub Comkeluar_Click()

Unload Me

End Sub

Private Sub CMDLG_Click()

TXTNM.SetFocus

TXTNM.Text = “”

TXTNPM.Text = “”

TXTJUR.Text = “”

TXTPS.Text = “”

TXTTHM.Text = “”

TXTNUR.Text = “”

End Sub

Private Sub CMDprs_Click()

Dim s As String

TXTTHM.Text = “20” & Left(TXTNPM.Text, 2)

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

If s = “1” Then

TXTJUR.Text = “Sistem Informasi”

ElseIf s = “2” Then

TXTJUR.Text = “Manajemen Informatika”

ElseIf s = “3” Then

TXTJUR.Text = “Teknik Informatika”

ElseIf s = “4” Then

TXTJUR.Text = “Manajemen & Komputer Akuntansi”

End If

s = Mid(TXTNPM.Text, 4, 2)

If s = “01” Then

TXTPS.Text = “strata satu”

ElseIf s = “02” Then

TXTPS.Text = “diploma tiga”

ElseIf s = “03” Then

TXTPS.Text = “diploma empat”

ElseIf s = “04” Then

TXTPS.Text = “diploma dua”

End If

TXTNUR.Text = Right(TXTNPM.Text, 3)

End Sub

Private Sub FORM_ACTIVATE()

TXTNM.SetFocus

TXTNM.Text = “”

TXTNPM.Text = “”

TXTJUR.Text = “”

TXTPS.Text = “”

TXTTHM.Text = “”

TXTNUR.Text = “”

End Sub

Private Sub TxtNM_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTNPM.SetFocus

End If

End Sub

angel temen gbr

Private Sub Cmdbatal_Click()

Txtnidn.SetFocus

Txtnidn.Text = “”

txtnp.Text = “”

CBOGOLONGAN.Text = “”

txtgapok.Text = “”

txttj.Text = “”

txtpj.Text = “”

txttt.Text = “”

End Sub

Private Sub Cbogolongan_Click()

Dim gaji, pajak, tunjangan, total As Variant

Select Case CBOGOLONGAN.Text

Case “I”

gaji = 1500000

tunjangan = 150000

Case “II”

gaji = 2000000

tunjangan = 200000

Case “III”

gaji = 2500000

tunjangan = 250000

Case “IV”

gaji = 3000000

tunjangan = 300000

Case Else

gaji = 0

tunjangan = 0

End Select

total = gaji + tunjangan

pajak = total * 0.1

txtgapok.Text = gaji

txttj.Text = tunjangan

txtpj.Text = pajak

txttt.Text = total – pajak

End Sub

Private Sub Cmdkl_Click()

Unload Me

End Sub

Private Sub cmdlg_Click()

Txtnidn.SetFocus

Txtnidn.Text = “”

txtnp.Text = “”

CBOGOLONGAN.Text = “”

txtgapok.Text = “”

txttj.Text = “”

txtpj.Text = “”

txttt.Text = “”

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

txtnp.SetFocus

End If

End Sub

huruf mutu

Private Sub Cmdbt_Click()

CBONPM.SetFocus

CBONPM.Text = “”

TXTNM.Text = “”

TXTJUR.Text = “”

TXTNQ.Text = “”

TXTNT.Text = “”

TXTUTS.Text = “”

TXTUAS.Text = “”

TXTNAK.Text = “”

TXTHM.Text = “”

End Sub

Private Sub Cbonpm_Click()

Dim nama, jurusan, hm As String

Select Case CBONPM.Text

Case “12201171”

nama = “sunarman”

jurusan = “Manajement Informatika”

Case “12100690”

nama = “diar junaidi”

jurusan = “Sistem Informasi”

Case “12201788”

nama = “Saskia Meca”

jurusan = “Teknik Informatika”

End Select

TXTNM.Text = nama

TXTJUR.Text = jurusan

TXTNQ.SetFocus

End Sub

Private Sub Cmdkl_Click()

Unload Me

End Sub

Private Sub Cmdprs_Click()

Dim nilai As Integer

Dim hm As String

quiss = Val(TXTNQ.Text)

tugas = Val(TXTNT.Text)

uts = Val(TXTUTS.Text)

uas = Val(TXTUAS.Text)

nilai = (quiss + tugas + uts + uas) / 4

TXTNAK.Text = nilai

Select Case TXTNAK.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 “12201171”

CBONPM.AddItem “12100690”

CBONPM.AddItem “12201788”

End Sub

Private Sub Txtnq_keypress(keyascii As Integer)

If keyascii = 13 Then

TXTNT.SetFocus

End If

End Sub

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

Untitled

Option Explicit

Private Sub Check1_Click()

Label2.FontBold = Check1.Value

End Sub

Private Sub Check2_Click()

Label2.FontItalic = Check2.Value

End Sub

Private Sub Command1_Click()

Label2.Caption = Text1.Text

End Sub

Private Sub Command2_Click()

End

End Sub

Private Sub Option1_Click()

Label2.ForeColor = vbBlue

End Sub

Private Sub Option2_Click()

Label2.ForeColor = vbRed

End Sub

diskon

Option Explicit

 

Private Sub CMDQU_Click()

End

End Sub

 

Private Sub CMDUL_Click()

TXTHA = “”

TXTDIS = “”

TXTAKH = “”

 

End Sub

 

Private Sub TXTHA_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TXTDIS.Text = Val(TXTHA.Text) * 0.1

TXTAKH.Text = Val(TXTHA.Text) – Val(TXTDIS.Text)

End If

End Sub

 

tugas 6

vb kalkulator

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Text4.Text = Val(Text1.Text) * Val(Text2.Text)
Text5.Text = Val(Text1.Text) – Val(Text2.Text)
Text6.Text = Val(Text1.Text) / Val(Text2.Text)

End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1 = “”
Text2 = “”
Text3 = “”
Text4 = “”
Text5 = “”
Text6 = “”

End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

tugas 5

vbnnnnn3

Private Sub Command1_Click()
txtNPM.SetFocus
TxtNM = “”
TxtPS = “”
TxtJ = “”
TxtS = “”
txtNPM = “”
End Sub

Private Sub Command2_Click()
txtNPM.SetFocus
TxtNM = “”
TxtPS = “”
TxtJ = “”
TxtS = “”
txtNPM = “”
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Activate()
txtNPM.SetFocus
End Sub

Private Sub TXTNPM_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtNM.SetFocus
End If
End Sub

Private Sub TXTNM_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtPS.SetFocus
End If
End Sub

Private Sub TXTPS_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtJ.SetFocus
End If
End Sub

Private Sub TXTJ_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtS.SetFocus
End If
End Sub

tugas 4

vb nnnnnnn

Option Explicit

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text1 = “”
Text2 = “”
Text3 = “”
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End If
End Sub

tugas 3

vb nnnnnnn

Option Explicit

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

tugas 2

vb nnnnnnn

Option Explicit

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End If

End Sub