TUGAS PEMROGRAMAN 1

TUGAS 1

1

11.PNG

Private Sub Chkbold_Click()

‘membuat teks tebal’

If Chkbold.Value = 1 Then

Lblteks.FontBold = True

Else

Lblteks.FontBold = False

End If

End Sub

Private Sub Chkitalic_Click()

‘membuat teks miring’

If Chkitalic.Value = 1 Then

Lblteks.FontItalic = True

Else

Lblteks.FontItalic = False

End If

End Sub

 

Private Sub Chkstrikethru_Click()

‘membuat teks garis tengah’

If Chkstrikethru.Value = 1 Then

Lblteks.FontStrikethru = True

Else

Lblteks.FontStrikethru = False

End If

End Sub

 

Private Sub Chkunderline_Click()

‘membuat teks bergaris bawah’

If Chkunderline.Value = 1 Then

Lblteks.FontUnderline = True

Else

Lblteks.FontUnderline = False

End If

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 2

2.PNG

22.PNG

Private Sub Chkmiring_Click()

If Chkmiring.Value = 1 Then

Label2.FontItalic = True

Else

Label2.FontItalic = False

End If

End Sub

 

Private Sub Chktebal_Click()

If Chktebal.Value = 1 Then

Label2.FontBold = True

Else

Label2.FontBold = False

End If

End Sub

 

Private Sub Cmdok_Click()

Label2.Caption = text1.Text

End Sub

 

Private Sub Cmdselesai_Click()

End

End Sub

 

Private Sub Optblue_Click()

Label2.ForeColor = vbBlue

End Sub

 

Private Sub Optred_Click()

Label2.ForeColor = vbRed

End Sub

 

TUGAS 3

tiga.PNG

33.PNG

Private Sub CboNpm_Click()

Dim nama, jurusan, HM As String

 

Select Case CboNpm.Text

Case “15100003”

nama = “Renita Fitri Andrianti”

jurusan = “Sistem Informasi”

Case “15100007”

nama = “Evi Setyorini”

jurusan = “Sistem Informasi”

Case “15100031”

nama = “Artika Kustriyani”

jurusan = “Sistem Informasi”

Case “15100034”

nama = “Dimas Bima Ananta”

jurusan = “Sistem Informasi”

End Select

TxtNm.Text = nama

TxtJr.Text = jurusan

TxtQs.SetFocus

End Sub

 

Private Sub Cmdbatal_Click()

CboNpm.SetFocus

CboNpm.Text = “”

TxtNm.Text = “”

TxtJr.Text = “”

TxtQs.Text = “”

TxtTgs.Text = “”

TxtUts.Text = “”

TxtUas.Text = “”

TxtNa.Text = “”

LblHM.Text = “”

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Cmdproses_Click()

Dim NA As Integer

Dim HM As String

QUIS = Val(TxtQs.Text)

TUGAS = Val(TxtTgs.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 “15100003”

CboNpm.AddItem “15100007”

CboNpm.AddItem “15100031”

CboNpm.AddItem “15100034”

 

End Sub

 

Private Sub TxtQs_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtTgs.SetFocus

End If

End Sub

 

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

 

TUGAS 4

empat.PNG

44.PNG

Private Sub Cbonpm_click()

Dim nama, jurusan, HM As String

 

Select Case Cbonpm.Text

Case “15100003”

nama = “Renita Fitri Andriyanti”

jurusan = “Sistem Informasi”

Case “15100007”

nama = “Evi Setyorini”

jurusan = “Sistem Informasi”

Case “15100031”

nama = “Artika Kustriyani”

jurusan = “Sistem Informasi”

Case “15100034”

nama = “Dimas Bima Ananta”

jurusan = “Sistem Informasi”

End Select

TxtNM.Text = nama

Txtjr.Text = jurusan

Txtnilaiq.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

 

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Cmdproses_Click()

Dim NA As Integer

Dim HM As String

QUIS = Val(Txtnilaiq.Text)

TUGAS = Val(Txtnilait.Text)

UTS = Val(Txtuts.Text)

UAS = Val(Txtuas.Text)

NA = (QUIS + TUGAS + UTS + UAS) / 4

Txtnilaia.Text = NA

 

Select Case Txthm.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 “15100003”

Cbonpm.AddItem “15100007”

Cbonpm.AddItem “15100031”

Cbonpm.AddItem “15100034”

 

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 txtnilaiq_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnilait.SetFocus

End If

End Sub

 

Private Sub txtnilait_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtuts.SetFocus

End If

End Sub

 

Private Sub Txtuas_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim NA As Integer

Dim HM As String

QUIS = Val(Txtnilaiq.Text)

TUGAS = Val(Txtnilait.Text)

UTS = Val(Txtuts.Text)

UAS = Val(Txtuas.Text)

NA = (QUIS + TUGAS + UTS + UAS) / 4

Txtnilaia.Text = NA

 

Select Case Txthm.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 If

End Sub

 

Private Sub txtuts_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtuas.SetFocus

End If

End Sub

 

Iklan