Tugas 1

DISKON 10%
Private Sub command1_Click()
Dim A, B, C As Double
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
Text3.Text = Val(Text1.Text) / 0.1
Text3.Text = Val(Text1.Text) – Val(Text2.Text)
End Sub
Private Sub command3_Click()
End
End Sub
Private Sub command2_Click()
Text2.SetFocus
Text1.Text = “”
Text2.Text = “”
Text3.Text = “”
End Sub
…………………………….
PERKALIAN  DUA  BILANGAN

Private Sub cmdbersih_Click()
txtnilai1.SetFocus
txtnilai1 = ” ”
txtnilai2 = ” ”
txthasil = ” ”
End Sub

Private Sub cmdhitung_Click()
Dim a, b, c As Double
a = Val(txtnilai1.Text)
b = Val(txtnilai2.Text)
c = (a * b)txthasil.Text = c
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub txtnilai1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnilai2.SetFocus
End If
End Sub

Private Sub txtnilai2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txthasil.SetFocus
End If
End Sub
…………………………………………………………………………………………………….

PERHITUNGAN GAJI

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdproses_Click()
Dim a, b, c, d, e, f As Double
a = Val(txt1.Text)
b = Val(txt2.Text)
c = Val(txt3.Text)
d = Val(txt4.Text)
e = Val(txt5.Text)
f = Val(txt6.Text)
d = (a + b – c)
txt4.Text = d
e = (d * 0.1)
txt5.Text = e
f = (d – e)
txt6.Text = f
End Sub

Private Sub cmdulang_Click()
txt1.SetFocus
txt1 = “”
txt2 = “”
txt3 = “”
txt4 = “”
txt5 = “”
txt6 = “”
End Sub

Private Sub txt4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt5.SetFocus
End If
End Sub

Private Sub txt5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt6.SetFocus
End If
End Sub

Private Sub txt1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt2.SetFocus
End If
End Sub

Private Sub txt3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt4.SetFocus
End If
End Sub

Private Sub txt2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txt3.SetFocus
End If
End Sub
……………………………………………………………………………………………………

FONT COLOR DAN FONT STYLE

Private Sub optRed_Click()
‘Membuat teks bewarna 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
………………………………………………………………………………………………………

HURUF MUTU MAHASISWA STMIK PRINGSEWU
Private Sub Cbonpm_Click()
Dim nama, jurusan, HM As String
Select Case Cbonpm.Text
Case “09100027”
nama = “AFNAN ZALFA SALSABILA A”
jurusan = “Sistem Informasi”
Case “09200048”
nama = “AMALIA AMANAH”
jurusan = “Manajemen Informatika”
Case “09300024”
nama = “SASKIA MECHA”
jurusan = “Tehnik Informatika”
End Select
txtnama.Text = nama
txtjurusan.Text = jurusan
txtquis.SetFocus
End Sub
………………………………………………………………………………………………………

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 )

Gambar Twitter

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

Foto Facebook

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

Foto Google+

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

Connecting to %s