-->

Halaman

Selasa, 12 Desember 2017

Tugas 3_7



Private Sub cmdbatal_Click()
textnama = ""
textnik = ""
textgolongan = ""
textkode = ""
textstatus = ""
texttahun = ""
textjabatan = ""
textbagian = ""
textgaji = ""
texttunjangan = ""
texttotal = ""
textnama.SetFocus
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
textnama = ""
textnik = ""
textgolongan = ""
textkode = ""
textstatus = ""
texttahun = ""
textjabatan = ""
textbagian = ""
textgaji = ""
texttunjangan = ""
texttotal = ""
textnama.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim S As String
texttahun = Left(textnik, 4)
S = Mid(textnik, 5, 1)
If S = "A" Then
textgolongan = "A"
textjabatan = "Manajer"
textgaji = "4000000"
texttunjangan = "1025000"
ElseIf S = "B" Then
textgolongan = "B"
textjabatan = "Ka. Seksi"
textgaji = "3500000"
texttunjangan = "975000"
ElseIf S = "C" Then
textgolongan = "C"
textjabatan = "Staff"
textgaji = "3000000"
texttunjangan = "925000"
End If
S = Mid(textnik, 7, 1)
If S = "S" Then
textkode = "S"
textstatus = "Single"
ElseIf S = "M" Then
textkode = "M"
textstatus = "Menikah"
ElseIf S = "J" Then
textkode = "J"
textstatus = "Janda"
ElseIf S = "D" Then
textkode = "D"
textstatus = "Duda"
End If
S = Right(textnik, 3)
If S = "KEU" Then
textbagian = "Accounting"
ElseIf S = "ADM" Then
textbagian = "Administrasi"
ElseIf S = "SDM" Then
textbagian = "General Affair"
ElseIf S = "EDP" Then
textbagian = "IT Unit"
ElseIf S = "SPM" Then
textbagian = "Security"
End If
texttotal = Val(textgaji) + Val(texttunjangan)
End Sub

tugas 3_6



Private Sub cmdbatal_Click()
textcode = ""
textjudul = ""
textpengarang = ""
textterbit = ""
textpenerbit = ""
textharga = ""
textcode.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim A As String
A = Left(textcode, 3)
If A = "SIM" Then
textjudul = "Sistem Informasi Manajemen"
textpengarang = "Fadiya Ulfa"
textharga = "75900"
ElseIf A = "EDP" Then
textjudul = "Elektronik Data Processing"
textpengarang = "Nurul Agustina"
textharga = "62000"
ElseIf A = "MNJ" Then
textjudul = "Manajemen"
textpengarang = "Rian Hidayat"
textharga = "42000"
ElseIf A = "CDR" Then
textjudul = "Corel Draw"
textpengarang = "Siti Nur Khotimah"
textharga = "53000"
ElseIf A = "RPL" Then
textjudul = "Rekayasa Perangkat Lunak"
textpengarang = "Winda Erlianti"
textharga = "83000"
End If
textterbit = "20" & Mid(textcode, 5, 2)
A = Right(textcode, 1)
If A = "A" Then
textpenerbit = "Andi Offset Yogyakarta"
ElseIf A = "I" Then
textpenerbit = "Indah Surabaya"
ElseIf A = "S" Then
textpenerbit = "Salemba Empat"
ElseIf A = "E" Then
textpenerbit = "Elek Media Komputindo"
ElseIf A = "M" Then
textpenerbit = "Maxicom"
End If
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
textcode = ""
textjudul = ""
textpengarang = ""
textterbit = ""
textpenerbit = ""
textharga = ""
textcode.SetFocus
End Sub

tugas 3_5



Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
textkode = ""
textharga = ""
textjenis = ""
textjb = ""
textjumlah = ""
texttotal = ""
textkode.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim B As String
B = Left(textkode, 3)
If B = "BIM" Then
textharga = "50000"
textjenis = "BIMA"
textjb = "16.00"
ElseIf B = "EKO" Then
textharga = "35000"
textjenis = "EKONOMI"
textjb = "19.00"
ElseIf B = "MUT" Then
textharga = "23000"
textjenis = "MUTIARA"
textjb = "17.00"
ElseIf B = "SEN" Then
textharga = "15000"
textjenis = "SENJA"
textjb = "20.00"
End If
textjumlah.SetFocus
End Sub

Private Sub textjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
texttotal = Val(textharga) * Val(textjumlah)
End If
End Sub

tugas 3_4



Private Sub cmdbatal_Click()
textcode = ""
textjudul = ""
textpengarang = ""
textterbit = ""
textpenerbit = ""
textharga = ""
textcode.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim A As String
A = Left(textcode, 3)
If A = "SIM" Then
textjudul = "Sistem Informasi Manajemen"
textpengarang = "Fadiya Ulfa"
textharga = "75900"
ElseIf A = "EDP" Then
textjudul = "Elektronik Data Processing"
textpengarang = "Nurul Agustina"
textharga = "62000"
ElseIf A = "MNJ" Then
textjudul = "Manajemen"
textpengarang = "Rian Hidayat"
textharga = "42000"
ElseIf A = "CDR" Then
textjudul = "Corel Draw"
textpengarang = "Siti Nur Khotimah"
textharga = "53000"
ElseIf A = "RPL" Then
textjudul = "Rekayasa Perangkat Lunak"
textpengarang = "Winda Erlianti"
textharga = "83000"
End If
textterbit = "20" & Mid(textcode, 5, 2)
A = Right(textcode, 1)
If A = "A" Then
textpenerbit = "Andi Offset Yogyakarta"
ElseIf A = "I" Then
textpenerbit = "Indah Surabaya"
ElseIf A = "S" Then
textpenerbit = "Salemba Empat"
ElseIf A = "E" Then
textpenerbit = "Elek Media Komputindo"
ElseIf A = "M" Then
textpenerbit = "Maxicom"
End If
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
textcode = ""
textjudul = ""
textpengarang = ""
textterbit = ""
textpenerbit = ""
textharga = ""
textcode.SetFocus
End Sub

Tugas 3_3

Private Sub cbocode_Click()
Dim merk As String
merk = Mid(cbocode, 7, 5)
If merk = "MC965" Then
textmerk = "Apple MacBook Air MC965"
harga = "12800000"
ElseIf merk = "MC966" Then
textmerk = "Apple MacBook Air MC966"
harga = "15800000"
ElseIf merk = "MC968" Then
textmerk = "Apple MacBook Air MC968"
harga = "9900000"
ElseIf merk = "MC969" Then
textmerk = "Apple MacBook Air MC969"
harga = "11900000"
ElseIf merk = "MC700" Then
textmerk = "Apple MacBook Pro MC700"
harga = "10800000"
ElseIf merk = "MC721" Then
textmerk = "Apple MacBook Pro MC721"
harga = "15900000"
ElseIf merk = "MC723" Then
textmerk = "Apple MacBook Pro MC723"
harga = "19300000"
ElseIf merk = "MC724" Then
textmerk = "Apple MacBook Pro MC724"
harga = "13700000"
ElseIf merk = "MC311" Then
textmerk = "Apple MacBook Pro MC311"
harga = "24200000"
ElseIf merk = "MC313" Then
textmerk = "Apple MacBook Pro MC313"
harga = "11900000"
ElseIf merk = "MC314" Then
textmerk = "Apple MacBook Pro MC314"
harga = "14700000"
ElseIf merk = "MC318" Then
textmerk = "Apple MacBook Pro MC318"
harga = "17600000"
ElseIf merk = "MC322" Then
textmerk = "Apple MacBook Pro MC322"
harga = "21300000"
ElseIf merk = "MC965" Then
textmerk = "Apple MacBook Air MC965"
harga = "12800000"
ElseIf merk = "MC966" Then
textmerk = "Apple MacBook Air MC966"
harga = "15800000"
End If
textsatuan = harga
textjumlahjual.SetFocus
End Sub

Private Sub Form_Load()
cbocode.AddItem "Apple MC965 MacBook Air"
cbocode.AddItem "Apple MC966 MacBook Air"
cbocode.AddItem "Apple MC968 MacBook Air"
cbocode.AddItem "Apple MC969 MacBook Air"
cbocode.AddItem "Apple MC700 MacBook Pro"
cbocode.AddItem "Apple MC721 MacBook Pro"
cbocode.AddItem "Apple MC723 MacBook Pro"
cbocode.AddItem "Apple MC724 MacBook Pro"
cbocode.AddItem "Apple MC311 MacBook Pro"
cbocode.AddItem "Apple MC313 MacBook Pro"
cbocode.AddItem "Apple MC314 MacBook Pro"
cbocode.AddItem "Apple MC318 MacBook Pro"
cbocode.AddItem "Apple MC322 MacBook Pro"
cbocode.AddItem "Apple MC965 MacBook Air"
cbocode.AddItem "Apple MC966 MacBook Air"
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
cbocode = ""
textmerk = ""
textsatuan = ""
textjumlahjual = ""
texthp = ""
textdis = ""
texttb = ""
cbocode.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim harga, dis, total As String
harga = Val(textjumlahjual) * (textsatuan)
texthp = harga
If texthp > "140000000" Then
dis = Val(texthp) * 0.15
ElseIf texthp > "135000000" Then
dis = Val(txthp) * 0.1
ElseIf texthp > "130000000" Then
dis = Val(texthp) * 0.05
ElseIf texthp > "125000000" Then
dis = Val(texthp) * 0.02
End If
textdis = dis
texttb = Val(texthp) - Val(textdis)
End Sub

tugas 3_2

Private Sub cmdbatal_Click()
textnama = ""
textnpm = ""
textjurusan = ""
textps = ""
textmasuk = ""
texturut = ""
textnama.SetFocus
End Sub

Private Sub cmdlagi_Click()
textnama = ""
textnpm = ""
textjurusan = ""
textps = ""
textmasuk = ""
texturut = ""
textnama.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim s As String
textmasuk = "20" & Left(textnpm, 2)
s = Mid(textnpm, 3, 1)
If s = "1" Then
textjurusan = "sistem informasi"
ElseIf s = "2" Then
textjurusan = "sistem informasi"
ElseIf s = "3" Then
textjurusan = "sistem informasi"
ElseIf s = "4" Then
textjurusan = "sistem informasi"
End If
s = Mid(textnpm, 4, 2)
If s = "00" Then
textps = "strata satu"
ElseIf s = "01" Then
textps = "Diploma Tiga"
ElseIf s = "02" Then
textps = "diploma empat"
ElseIf s = "03" Then
textps = "diploma dua"
End If
texturut = Right(textnpm.Text, 3)
End Sub

Private Sub Command3_Click()
Unload Me
End Sub


Private Sub textnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textnpm.SetFocus
End If
End Sub

tugas 3_1



Private Sub cbogolongan_Click()
Dim gaji, pajak, tunjangan, terima As Variant
Select Case cbogolongan
Case "I"
gaji = 1750000
tunjangan = 175000
Case "II"
gaji = 2500000
tunjangan = 250000
Case "III"
gaji = 3250000
tunjangan = 325000
Case "IV"
gaji = 4000000
tunjangan = 400000
End Select
total = gaji + tunjangan
pajak = total * 0.1
textgaji = gaji
texttunjangan = tunjangan
textpajak = pajak
textterima = total - pajak
End Sub

Private Sub cmdbatal_Click()
textnidn = ""
textnama = ""
cbogolongan = ""
textgaji = ""
texttunjangan = ""
textpajak = ""
textterima = ""
textnidn.SetFocus
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
textnidn = ""
textnama = ""
cbogolongan = ""
textgaji = ""
texttunjangan = ""
textpajak = ""
textterima = ""
textnidn.SetFocus
End Sub

Private Sub Form_Load()
cbogolongan.AddItem "I"
cbogolongan.AddItem "II"
cbogolongan.AddItem "III"
cbogolongan.AddItem "Iv"
End Sub


Private Sub textnidn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textnama.SetFocus
End If
End Sub

Selasa, 21 November 2017

HURUF MUTU MAHASISWA STMIK DENGAN KEYPRESS



Private Sub batal_Click()
cbonpm.SetFocus
cbonpm.Text = ""
txtnama.Text = ""
txtjurusan.Text = ""
txtquis.Text = ""
txttugas.Text = ""
txtuts.Text = ""
txtuas.Text = ""
txtnilaiakhir.Text = ""
txthm.Text = ""
End Sub


Private Sub cbonpm_Click()
Dim nama, jurusan, hm As String

Select Case cbonpm.Text
Case "17100025"
nama = "Nova Alfiatul Hasanah"
jurusan = "Sistem Informasi"
Case "17100001"
nama = "Mardalena"
jurusan = "Sistem Informasi"
Case "17100006"
nama = "Rosi Elvia"
jurusan = "Sistem Informasi"
Case "17100031"
nama = "Tuti Mulyani"
jurusan = "Sistem Informasi"
Case "171000o4"
nama = "Eka Kartika Pertiwi"
jurusan = "Sistem Informasi"
Case "17100035"
nama = "Ranti Wulantika"
jurusan = "Sistem Informasi"
End Select
txtnama.Text = nama
txtjurusan.Text = jurusan
txtquis.SetFocus
End Sub

Private Sub Form_Load()
cbonpm.AddItem "17100025"
cbonpm.AddItem "17100001"
cbonpm.AddItem "17100006"
cbonpm.AddItem "17100031"
cbonpm.AddItem "17100004"
cbonpm.AddItem "17100035"
End Sub

Private Sub proses_Click()
Dim na As Integer
Dim hm As String
quis = Val(txtquis.Text)
tugas = Val(txttugas.Text)
uts = Val(txtuts.Text)
uas = Val(txtuas.Text)
na = (quis + tugas + uts + uas) / 4
txtnilaiakhir.Text = na

Select Case txtnilaiakhir.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 quit_Click() Unload Me 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 txtuas_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtnilaiakhir.SetFocus Dim na As Integer Dim hm As String quis = Val(txtquis.Text) tugas = Val(txttugas.Text) uts = Val(txtuts.Text) uas = Val(txtuas.Text) na = (quis + tugas + uts + uas) / 4 txtnilaiakhir.Text = na Select Case txtnilaiakhir.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

HURUF MUTU MAHASISWA STMIK PRINGSEWU TANPA KEYPRESS


Private Sub batal_Click()
cbonpm.SetFocus
cbonpm.Text = ""
txtnama.Text = ""
txtjurusan.Text = ""
txtquis.Text = ""
txttugas.Text = ""
txtuts.Text = ""
txtuas.Text = ""
txtnilaiakhir.Text = ""
txthm.Text = ""
End Sub


Private Sub cbonpm_Click()
Dim nama, jurusan, hm As String

Select Case cbonpm.Text
Case "17100025"
nama = "Nova Alfiatul Hasanah"
jurusan = "Sistem Informasi"
Case "17100001"
nama = "Mardalena"
jurusan = "Sistem Informasi"
Case "17100006"
nama = "Rosi Elvia"
jurusan = "Sistem Informasi"
Case "17100031"
nama = "Tuti Mulyani"
jurusan = "Sistem Informasi"
Case "171000o4"
nama = "Eka Kartika Pertiwi"
jurusan = "Sistem Informasi"
Case "17100035"
nama = "Ranti Wulantika"
jurusan = "Sistem Informasi"
End Select
txtnama.Text = nama
txtjurusan.Text = jurusan
txtquis.SetFocus
End Sub

Private Sub Form_Load()
cbonpm.AddItem "17100025"
cbonpm.AddItem "17100001"
cbonpm.AddItem "17100006"
cbonpm.AddItem "17100031"
cbonpm.AddItem "17100004"
cbonpm.AddItem "17100035"
End Sub

Private Sub proses_Click()
Dim na As Integer
Dim hm As String
quis = Val(txtquis.Text)
tugas = Val(txttugas.Text)
uts = Val(txtuts.Text)
uas = Val(txtuas.Text)
na = (quis + tugas + uts + uas) / 4
txtnilaiakhir.Text = na

Select Case txtnilaiakhir.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 quit_Click() Unload Me End Sub

2_6


Private Sub chkmiring_Click()
Label2.FontItalic = chkmiring.Value
End Sub

Private Sub chktebal_Click()
Label2.FontBold = chktebal.Value
End Sub

Private Sub cmdbatal_Click()
Unload Me
End Sub

Private Sub cmdok_Click()
Label2.Caption = Text1.Text
End Sub


Private Sub optbiru_Click()
Label2.ForeColor = vbBlue
End Sub

Private Sub optmerah_Click()
Label2.ForeColor = vbRed
End Sub

2_5 NAMA DENGAN WARNA


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 bergaris'
If chkstrikethru.Value = 1 Then
lblteks.Fonestrikethru = 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 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

APLIKASI PERHITUNGAN GAJI DENGAN KEYPRESS

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdproses_Click()
textgajikotor = Val(textgajipokok) + Val(texttunjangan) - Val(textpotongan)
textpajak = Val(textgajikotor) * 0.1
textgajiditerima = Val(textgajikotor) - Val(textpajak)
End Sub


Private Sub cmdulang_Click()
textgajipokok = ""
texttunjangan = ""
textpotongan = ""
textgajikotor = ""
textpajak = ""
textgajiditerima = ""
End Sub

Private Sub textpotongan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textgajikotor = Val(textgajipokok) + Val(texttunjangan) - Val(textpotongan)
textpajak = Val(textgajikotor) * 0.1
textgajiditerima = Val(textgajikotor) - Val(textpajak)
End If
End Sub

Private Sub texttunjangan_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textpotongan.SetFocus
End If
End Sub

APLIKASI PERHITUNGAN GAJI TANPA KEYPRESS


Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdproses_Click()
textgajikotor = Val(textgajipokok) + Val(texttunjangan) - Val(textpotongan)
textpajak = Val(textgajikotor) * 0.1
textgajiditerima = Val(textgajikotor) - Val(textpajak)
End Sub


Private Sub cmdulang_Click()
textgajipokok = ""
texttunjangan = ""
textpotongan = ""
textgajikotor = ""
textpajak = ""
textgajiditerima = ""
End Sub

PERHITUNGAN DATA SETELAH DISKON 10% DENGAN KEPRESS


Private Sub cmdhitung_Click()
textdis = Val(textha) * 0.1
texthk = Val(textha) - Val(textdis)
End Sub

Private Sub cmdquit_Click()
Unload Me
End Sub

Private Sub cmdulangi_Click()
textha = ""
textdis = ""
texthk = ""
End Sub


Private Sub textdis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
texthk = Val(textha) - Val(textdis)
texthk.SetFocus
End If
End Sub

Private Sub textha_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textdis = Val(textha) * 0.1
textdis.SetFocus
End If
End Sub


Private Sub texthk_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textha.SetFocus
End If
End Sub

DATA SETELAH DISKON 10% TANPA KEYPRESS



Private Sub cmdhitung_Click()
textdis = Val(textha) * 0.1
texthk = Val(textha) - Val(textdis)
End Sub

Private Sub cmdquit_Click()
Unload Me
End Sub

Private Sub cmdulangi_Click()
textha = ""
textdis = ""
texthk = ""
End Sub

Selasa, 14 November 2017

kalkulator dengan keypress




Private Sub cmdbatal_Click()
textpenjumlahan1 = ""
textpenjumlahan2 = ""
textpenjumlahanhasil = ""
textpengurangan1 = ""
textpengurangan2 = ""
textpenguranganhasil = ""
textperkalian1 = ""
textperkalian2 = ""
textperkalianhasil = ""
textpembagian1 = ""
textpembagian2 = ""
textpembagianhasil = ""
textpenjumlahan1.SetFocus
End Sub

Private Sub cmdhitung_Click()
textpenjumlahanhasil = Val(textpenjumlahan1) + Val(textpenjumlahan2)
textpenguranganhasil = Val(textpengurangan1) - Val(textpengurangan2)
textperkalianhasil = Val(textperkalian1) * Val(textperkalian2)
textpembagianhasil = Val(textpembagian1) / Val(textpembagian2)
textpenjumlahan1.SetFocus
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
textpenjumlahan1 = ""
textpenjumlahan2 = ""
textpenjumlahanhasil = ""
textpengurangan1 = ""
textpengurangan2 = ""
textpenguranganhasil = ""
textperkalian1 = ""
textperkalian2 = ""
textperkalianhasil = ""
textpembagian1 = ""
textpembagian2 = ""
textpembagianhasil= ""
textpenjumlahan1.SetFocus
End Sub


Private Sub textpembagian1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textpembagian2.SetFocus
End If
End Sub


Private Sub textpembagian2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textpenjumlahanhasil = Val(textpenjumlahan1) + Val(textpenjumlaha2)
textpenguranganhasil = Val(textpengurangan1) - Val(textpengurangan2)
textperkalianhasil = Val(textperkalian1) * Val(textperkalian2)
textpembagianhasil = Val(textpembagian1) / Val(textpembagian2)
textpembagianhasil.SetFocus
End If
End Sub

Private Sub textpengurangan1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textpengurangan2.SetFocus
End If
End Sub

Private Sub textpengurangan2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textperkalian1.SetFocus
End If
End Sub

Private Sub textpenjumlahan1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textpenjumlahan2.SetFocus
End If
End Sub

Private Sub textpenjumlahan2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textpengurangan1.SetFocus
End If
End Sub

Private Sub textperkalian1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textperkalian2.SetFocus
End If
End Sub

Private Sub textperkalian2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textpembagian1.SetFocus
End If
End Sub

kalkulator tanpa keypress



Private Sub cmdbatal_Click()
textpenjumlahan1 = ""
textpenjumlahan2 = ""
textpenjumlahanhasil = ""
textpengurangan1 = ""
textpengurangan2 = ""
textpenguranganhasil = ""
textperkalian1 = ""
textperkalian2 = ""
textperkalianhasil = ""
textpembagian1 = ""
textpembagian2 = ""
textpembagianhasil = ""
textpenjumlahan1.SetFocus
End Sub

Private Sub cmdhitung_Click()
textpenjumlahanhasil = Val(textpenjumlahan1) + Val(textpenjumlahan2)
textpenguranganhasil = Val(textpengurangan1) - Val(textpengurangan2)
textperkalianhasil = Val(textperkalian1) * Val(textperkalian2)
textpembagianhasil = Val(textpembagian1) / Val(textpembagian2)
textpenjumlahan1.SetFocus
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
textpenjumlahan1 = ""
textpenjumlahan2 = ""
textpenjumlahanhasil = ""
textpengurangan1 = ""
textpengurangan2 = ""
textpenguranganhasil = ""
textperkalian1 = ""
textperkalian2 = ""
textperkalianhasil = ""
textpembagian1 = ""
textpembagian2 = ""
textpembagianhasil= ""
textpenjumlahan1.SetFocus
End Sub

penjumlahan dengan keypress



Private Sub cmdhitung_Click()
texttotal = Val(textn1) + Val(textn2)
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
textn1 = ""
textn2 = ""
texttotal = ""
textn1.SetFocus
End Sub

Private Sub textn1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textn2.SetFocus
End If
End Sub

Private Sub textn2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
texttotal = Val(textn1) + Val(textn2)
End If
End Sub


Penjumlahan tanpa keypress


Private Sub cmdhitung_Click()
texttotal = Val(textn1) + Val(textn2)
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
textn1 = ""
textn2 = ""
texttotal = ""
textn1.SetFocus
End Sub

Data Mahasiswa STMIK dengan keypress



Private Sub cmdbatal_Click()
textnpm = ""
textnama = ""
textalamat = ""
textnpm.SetFocus
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
textnpm = ""
textnama = ""
textalamat = ""
textnpm.SetFocus
End Sub

Private Sub textnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textalamat.SetFocus
End If
End Sub

Private Sub textnpm_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
textnama.SetFocus
End If
End Sub

Tugas 3_7

Private Sub cmdbatal_Click() textnama = "" textnik = "" textgolongan = "" textkode = "" texts...