TUGAS VB

TUGAS 1
Private Sub Optred_Click()
‘membuat teks berwarna merah
lblteks.ForeColor = vbRed
End Sub
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 cmdexit_Click()
End
End Sub

TUGAS 2
Private Sub CMDHITUNG_Click()
Dim a, b, c As Double
Txtb.Text = Val(Txta.Text) * 0.1
Txtc.Text = Val(Txta.Text) * Val(Txtb.Text)
End Sub
Private Sub CMDKELUAR_Click()
End
End Sub
Private Sub CMDULANGI_Click()
Txta = “”
Txtb = “”
Txtc = “”
End Sub

TUGAS 3
Private Sub CMDKELUAR_Click()
End
End Sub
Private Sub cmdPROSES_Click()
Dim a, b, c, d, e, f As Double
Txtd.Text = Val(Txta.Text) + Val(Txtb.Text) – Val(Txtc.Text)
Txte.Text = Val(Txtd.Text) * (0.1)
Txtf.Text = Val(Txtd.Text) – Val(Txte.Text)
End Sub
Private Sub CMDULANGI_Click()
Txta = “”
Txtb = “”
Txtc = “”
Txtd = “”
Txte = “”
Txtf = “”
End Sub

TUGAS 4

TUGAS 4
Private Sub Cbonpm_Change()
Dim nama, jurusan, HM As String
Select Case Cbonpm.Text
Case “11100168”
nama = “SUDARSONO”
jurusan = “Sistem Informasi”
Case “11100092”
nama “Debi Lisdia Paramita”
jurusan “Sistem Informasi”
Case “11100156”
nama “Nurul Khotimah”
jurusan “sistem informasi”
Case “11100146”
nama “mahbub ihwani”
jurusan “sistem informasi”
End Select
txtnama.Text = nama
txtjurusan.Text = jurusan = 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()
Unload Me
End Sub

Private Sub Cmdproses_Click()
Dim NA As Integer
Dim HM As String
quis = Val(txtquis.Text)
tugas = Val(txtquis.Text)
uts = Val(txtquis.Text)
uas = Val(txtquis.Text)
NA = (quis + tugas + uts + uas) / 4
Txtna.Text = NA

Select Case Txtna.Text
calse ls > 80
HM = “a”
calse ls > 70
HM = “b”
calse ls > 60
HM = “c”
calse ls > 50
HM = “d”
calse ls > 50
HM = “e”
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

V

Iklan
Pos ini dipublikasikan di Uncategorized. Tandai permalink.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s