Rabu, 22 November 2017

Tugas 2 Program 8 Bp1



Private Sub Form_Load()
Cbonpm.AddItem "17100075"
Cbonpm.AddItem "17200089"
Cbonpm.AddItem "16300212"
Cbonpm.AddItem "17400056"
Cbonpm.AddItem "15400586"
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
Private Sub txtuas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtuas.SetFocus
Dim NA As Integer
Dim HM As String
QUIS = Val(txtnq)
TUGAS = Val(txtnt)
UTS = Val(txtuts)
UAS = Val(txtuas)
NA = (QUIS + TUGAS + UTS + UAS) / 4
txtna.Text = NA


Select Case txtna
 Case Is = 100
 HM = "A"
 Case Is >= 80
 HM = "A"
 Case Is >= 70
 HM = "B"
 Case Is >= 60
 HM = "C"
 Case Is >= 50
 HM = "D"
 Case Is <= 49
 HM = "E"
  End Select
  txthm.Text = HM
End If
End Sub

Private Sub Cbonpm_Click()
Dim nama, jurusan, HM As String

Select Case Cbonpm
 Case "17100075"
 nama = "DWI AGUNG CAHYADI"
 jurusan = "Sistem Informasi"
 Case "17200089"
 nama = "IMAMUDDIN"
 jurusan = "Manajemen Informatika"
 Case "16300212"
 nama = "SUKINEM"
 jurusan = "Tehnik Sipil"
 Case "17400056"
 nama = "SAKIR KECIL"
 jurusan = "Tehnik Informatika"
 Case "15400586"
 nama = "MBAH WAGU"
 jurusan = "MANAGEMENT SISTEM INFORMASI"
 End Select
 txtnm = nama
 txtjr = jurusan
 txtnq.SetFocus
 End Sub

Private Sub Cmdbatal_Click()
Cbonpm.SetFocus
Cbonpm = ""
txtnm = ""
txtjr = ""
txtnq = ""
txtnt = ""
txtuts = ""
txtuas = ""
txtna = ""
txthm = ""
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdproses_Click()
Dim NA As Integer
Dim HM As String
QUIS = Val(txtquis)
TUGAS = Val(txttugas)
UTS = Val(txtuts)
UAS = Val(txtuas)
NA = (QUIS + TUGAS + UTS + UAS) / 4
txtna.Text = NA

Select Case txtna
 Case Is = 100
 HM = "A"
 Case Is >= 80
 HM = "A"
 Case Is >= 70
 HM = "B"
 Case Is >= 60
 HM = "C"
 Case Is >= 50
 HM = "D"
 Case Is <= 49
 HM = "E"
  End Select
  txthm.Text = HM
 End Sub

Tugas 2 Program 7 Bp1






























Private Sub Form_Load()
Cbonpm.AddItem "17100075"
Cbonpm.AddItem "17200089"
Cbonpm.AddItem "16300212"
Cbonpm.AddItem "17400056"
Cbonpm.AddItem "15400586"
End Sub

Private Sub Cbonpm_Click()
Dim nama, jurusan, HM As String

Select Case Cbonpm
 Case "17100075"
 nama = "DWI AGUNG CAHYADI"
 jurusan = "Sistem Informasi"
 Case "17200089"
 nama = "IMAMUDDIN"
 jurusan = "Manajemen Informatika"
 Case "16300212"
 nama = "SUKINEM"
 jurusan = "Tehnik Sipil"
 Case "17400056"
 nama = "SAKIR KECIL"
 jurusan = "Tehnik Informatika"
 Case "15400586"
 nama = "MBAH WAGU"
 jurusan = "MANAGEMENT SISTEM INFORMASI"
 End Select
 txtnm = nama
 txtjr = jurusan
 txtnq.SetFocus
 End Sub

Private Sub Cmdbatal_Click()
Cbonpm.SetFocus
Cbonpm = ""
txtnm = ""
txtjr = ""
txtnq = ""
txtnt = ""
txtuts = ""
txtuas = ""
txtna = ""
txthm = ""
End Sub

Private Sub Cmdkeluar_Click()
Unload Me
End Sub

Private Sub Cmdproses_Click()
Dim NA As Integer
Dim HM As String
QUIS = Val(txtnq)
TUGAS = Val(txtnt)
UTS = Val(txtuts)
UAS = Val(txtuas)
NA = (QUIS + TUGAS + UTS + UAS) / 4
txtna.Text = NA

Select Case txtna
 Case Is = 100
 HM = "A"
 Case Is >= 80
 HM = "A"
 Case Is >= 70
 HM = "B"
 Case Is >= 60
 HM = "C"
 Case Is >= 50
 HM = "D"
 Case Is <= 49
 HM = "E"
 End Select
 txthm.Text = HM
 End Sub

Tugas 2 Program 6 Bp1

Private Sub Cmdoke_Click()
lbltext1.Caption = txtnnm.Text
End Sub

Private Sub Cmdexit_Click()
End
End Sub

Private Sub Optbiru_Click()
lbltext1.ForeColor = vbBlue
End Sub

Private Sub Optred_Click()
lbltext1.ForeColor = vbRed
End Sub

Private Sub Chkbold_Click()
lbltext1.FontBold = Chkbold.Value
End Sub

Private Sub Chkitalic_Click()
lbltext1.FontItalic = Chkitalic.Value
End Sub



Tugas 2 Program 5 Bp1



Private Sub Cmdext_Click()
End
End Sub

Private Sub Optred_Click()
Lbltxt.ForeColor = vbRed
End Sub

Private Sub Optbiru_Click()
Lbltxt.ForeColor = vbBlue
End Sub

Private Sub Opthijau_Click()
Lbltxt.ForeColor = vbGreen
End Sub

Private Sub Optkuning_Click()
Lbltxt.ForeColor = vbYellow
End Sub

Private Sub chkbold_Click()
If Chkbold.Value = 1 Then
Lbltxt.FontBold = True
Else
Lbltxt.FontBold = False
End If
End Sub

Private Sub chkunderline_Click()
If Chkunderline.Value = 1 Then
Lbltxt.FontUnderline = True
Else
Lbltxt.FontUnderline = False
End If
End Sub

Private Sub chkstrikeout_Click()
If Chkstrikeout.Value = 1 Then
Lbltxt.FontStrikethru = True
Else
Lbltxt.FontStrikethru = False
End If
End Sub

Private Sub chkitalic_Click()
If Chkitalic.Value = 1 Then
Lbltxt.FontItalic = True
Else
Lbltxt.FontItalic = False
End If
End Sub

Tugas 2 Program 4 Bp1



Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdproses_Click()
txtgajik = Val(txtgajip) + Val(txttn) - Val(txtpotongan)
txtpajak = Val(txtgajik) * 0.05
txtgajid = Val(txtgajik) - Val(txtpajak)
End Sub

Private Sub cmdulang_Click()
txtgajip = ""
txttn = ""
txtpotongan = ""
txtgajik = ""
txtpajak = ""
txtgajid = ""
txtgajip.SetFocus
End Sub

Private Sub txtgajip_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttn.SetFocus
End If
End Sub

Private Sub txtpotongan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtgajid.SetFocus
txtgajik = Val(txtgajip) + Val(txttn) - Val(txtpotongan)
txtpajak = Val(txtgajik) * 0.05
txtgajid = Val(txtgajik) - Val(txtpajak)
End If
End Sub

Private Sub txttn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtpotongan.SetFocus
End If
End Sub