Upload presentasi
Presentasi sedang didownload. Silahkan tunggu
Diterbitkan olehEndah Fadillah Telah diubah "9 tahun yang lalu
1
Oleh : Nur Aminudin, S.Kom., M.T.I NIDN. 0222127602
Bila mendapat air yang kita timba dari sumur tampak keruh, kita akan mencari tawas (kaporit) untuk menjernihkannya. Demikian pun dalam mencari ilmu. Kita harus mencari ilmu yang bisa menjadi "tawas"-nya supaya kalau hati sudah bening, ilmu-ilmu lain yang kita kaji bisa diserap seraya membawa mamfaat. Oleh : Nur Aminudin, S.Kom., M.T.I NIDN STMIK Pringsewu - Lampung
2
Kontrol Property Setting Value Form Name frKali Caption Perkalian Label lblJudul Perkalian Dua Bilangan lblKali X Text txtBil1 Blank txtBil2 txtHasil Command cmdHitung &Hitung cmdBersih &Bersih cmdKeluar &Keluar
3
Private Sub cmdBersih_Click()
'Mengosongkan isi TextBox txtBil1.Text = "" txtBil2.Text = "" txtHasil.Text = "" End Sub Private Sub cmdHitung_Click() 'Deklarasi Variabel Lokal Dim a As Single Dim b As Single Hasil As Single a = txtBil1.Text b = txtBil2.Text Hasil = a * b txtHasil.Text = Hasil Private Sub cmdKeluar_Click() 'Mengakhiri Program End
4
Option Button Control, digunakan dalam suatu group, dimana seorang user dapat memilih salah satu saja dalam suatu group. Check Box Control, control ini digunakan untuk pilihan ya/tidak atau benar/salah.
5
Kontrol Property Setting Value
Form Name frFont Check chkBold Caption Font Color & Font Style Bold Label lblTeks chkItalic Microsoft Visual Basic 6.0 Italic Option optRed chkUnder Red Underline optGreen chkStrike Green Strikeout optBlue Frame Font Color Blue Font Style optYellow Command cmdExit Yellow &Exit
6
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 ‘Untuk pilihan font color yang ‘lain silakan Anda coba membuat ‘kode programnya ‘Untuk pilihan font style yang ‘lain silakan Anda buat kode ‘programnya
8
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 cmdQuit_Click() End Private Sub cmdUlangi_Click() txtA = "" txtB = "" txtC = ""
10
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) Private Sub cmdUlang_Click() txtA = "" txtB = "" txtC = "" txtD = "" txtE = "" txtF = ""
11
ComboBox Control, control ini merupakan gabungan antara TextBox dan ListBox Control, dimana daftar item hanya akan ditampilkan jika user men-click pada panah kebawah disebelah kanan Control tersebut
12
Private Sub Cbonpm_Click()
Dim nama, jurusan, HM As String Select Case Cbonpm.Text Case " " nama = "AFNAN ZALFA SALSABILA A" jurusan = "Sistem Informasi" Case " " nama = "AMALIA AMANAH" jurusan = "Manajemen Informatika" Case " " nama = "SASKIA MECHA" jurusan = "Tehnik Informatika" End Select txtnama.Text = nama txtjurusan.Text = jurusan txtquis.SetFocus End Sub
13
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
14
Private Sub Cmdproses_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 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
15
Private Sub Form_Load()
Cbonpm.AddItem " " Cbonpm.AddItem " " Cbonpm.AddItem " " End Sub Private Sub txtquis_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txttugas.SetFocus End If Private Sub txttugas_KeyPress(KeyAscii As Integer) txtuts.SetFocus Private Sub txtuts_KeyPress(KeyAscii As Integer) txtuas.SetFocus
17
Private Sub Command1_Click()
Label2.Caption = Text1.Text End Sub Private Sub Command2_Click() End Private Sub Option1_Click() Label2.ForeColor = vbBlue Private Sub Option2_Click() Label2.ForeColor = vbRed Private Sub Check1_Click() Label2.FontBold = Check1.Value Private Sub Check2_Click() Label2.FontItalic = Check2.Value
19
Private Sub Cmdbatal_Click()
kosong End Sub Private Sub cmdlagi_Click() Private Sub Form_load() cbogolongan.AddItem "I" cbogolongan.AddItem "II" cbogolongan.AddItem "III" cbogolongan.AddItem "IV" Private Sub Cmdkeluar_Click() Unload Me
20
Private Sub cbogolongan_Click()
Dim gapok, pajak, tunjangan, total As Variant Select Case cbogolongan.Text Case "I" gapok = tunjangan = Case "II" gapok = tunjangan = Case "III" gapok = tunjangan = Case "IV" gapok = tunjangan = Case Else gapok = 0 tunjangan = 0 End Select total = gapok + tunjangan pajak = total * 0.1 txtgapok.Text = gapok txttunjangan.Text = tunjangan txtpajak.Text = pajak txttotal.Text = total - pajak End Sub
21
Public Sub kosong() txtnidn.SetFocus txtnidn.Text = "" txtnama.Text = "" cbogolongan.Text = "" txtgapok.Text = "" txttunjangan.Text = "" txtpajak.Text = "" txttotal.Text = "" End Sub Private Sub txtnind_keypress(keyascii As Integer) If keyascii = 13 Then txtnama.SetFocus End If
23
Private Sub Cmdbatal_Click()
Txtnama.SetFocus Txtnama.Text = "" Txtnpm.Text = "" Txtjur.Text = "" Txtps.Text = "" TxtTm.Text = "" Txturut.Text = "" End Sub Private Sub Cmdkeluar_Click() Unload Me Private Sub Cmdlagi_Click()
24
Private Sub Cmdproses_Click()
Dim S As String TxtTm.Text = "20" & Left(Txtnpm.Text, 2) S = Mid(Txtnpm.Text, 3, 1) If S = "1" Then Txtjur.Text = "Sistem Informasi" ElseIf S = "2" Then Txtjur.Text = "Manajemen Informatika" ElseIf S = "3" Then Txtjur.Text = "Tehnik Informatika" ElseIf S = "4" Then Txtjur.Text = "Manajemen & Komp. Akuntansi" End If S = Mid(Txtnpm.Text, 4, 2) If S = "01" Then Txtps.Text = "Strata Satu" ElseIf S = "02" Then Txtps.Text = "Diploma Tiga" ElseIf S = "03" Then Txtps.Text = "Diploma Empat" ElseIf S = "04" Then Txtps.Text = "Diploma Dua" Txturut.Text = Right(Txtnpm.Text, 3) End Sub
25
Private Sub Form_activate()
Txtnama.SetFocus Txtnama.Text = "" Txtnpm.Text = "" Txtjur.Text = "" Txtps.Text = "" TxtTm.Text = "" Txturut.Text = "" End Sub Private Sub Txtnama_Keypress(Keyascii As Integer) If Keyascii = 13 Then Txtnpm.SetFocus End If
Presentasi serupa
© 2024 SlidePlayer.info Inc.
All rights reserved.