Modul Pemrograman Vb-1

download Modul Pemrograman Vb-1

of 145

  • date post

    26-Jul-2015
  • Category

    Documents

  • view

    936
  • download

    0

Embed Size (px)

Transcript of Modul Pemrograman Vb-1

MODUL PEMROGRAMAN VISUAL BASIC(UNTUK KALANGAN SENDIRI)

085252711174

SEKOLAH TINGGI MANAJEMEN INFORMATIKA DAN KOMPUTER

(STMIK) PRANATA INDONESIAJl. Raya Pondok Gede, No. 21, Pondok Gede, Bekasi - Tlp. 021-8467364 Pondok Gede- BekasiSTMIK PRANATA INDONESIA

1

Pemrograman Visual Basic

PENGANTARKATA PENGANTARModul Pemrograman Visual Basic ini dibuat dengan tujuan untuk memperkenalkan Lingkungan Visual Basic, pembuatan interface dengan menggunakan tools yang ada serta mengimplementasikan program sederhana

dengan bahasa Visual Basic. Disamping itu juga untuk memahami struktur dan perintah-perintah program bahasa Visual Basic. Terutama sekali untuk memberikan tambahan literatur bagi Mahasiswa STMIK Palangkaraya dalam menempuh matakuliah

Pemrograman Visual Basic. Dalam modul ini terdiri dari 12 Bab yang diberikan untuk satu semester. Pada setiap pertemuan diberikan contoh-contoh program dan latihannya, diharapkan dengan mencoba contoh program yang ada dan mengerjakan latihannya, mahasiswa lebih mudah untuk memahami materi yang diberikan. Penyusun berharap semoga modul ini bisa membantu pembacanya khususnya bagi mahasiswa STMIK Palangkaraya dalam belajar bahasa pemrograman Visual Basic. Tentunya dalam modul ini juga masih terdapat kekurangankekurangan maka dalam kesempatan ini penyusun menerima segala macam kritik yang bersifat konstruktif demi perbaikan materi pada modul ini di masa mendatang. Terima Kasih.

Pondok Gede, Juli 2011 Penyusun

STMIK PRANATA INDONESIA

2

Pemrograman Visual Basic

DAFTAR ISIPENGANTAR ............................................................................................................. DAFTAR ISI ................................................................................................................. DAFTAR TABEL .......................................................................................................... DAFTAR GAMBAR .................................................................................................... BAB I PENDAHULUAN .................................................................................. A. Perkembangan Bahasa Basic ................................................. B. Mengenal Visual Basic .............................................................. 1. Standar Edition ...................................................................... 2. Profesional Edition ................................................................ 3. Enterprise Edition .................................................................. C. Mengenal Inetegrated Development Environment (IDE) .. 1. Menjalankan IDE ................................................................... 2. Memilih Tipe Project ............................................................. D. Komponen IDE dalam VB 6.0 ................................................... 1. Project Window ..................................................................... 2. Form Designer ....................................................................... 3. Toolbox ................................................................................... 4. Properties Window ............................................................... 5. Code Window ....................................................................... 6. Module ................................................................................... 7. Color Pallete Window .......................................................... 8. Form Layout Window ........................................................... 9. Immediate Window ............................................................. 10. Object Browser ..................................................................... 11. Locals Window ...................................................................... 12. Watch Window ..................................................................... 13. Call Stack Window ............................................................... E. Menu, Toolbar dan ToolBox ...................................................... 1. Menu ....................................................................................... 2. Toolbar .................................................................................... 3. ToolBox .................................................................................... F. Menyimpan Project .................................................................... G. Menjalankan dan Menghentikan Program .......................... BAB II TIPE DATA, VARIABEL dan KONSTANTA, OPERATOR dan KONTROL PROGRAM .......................................... A. Tipe Data dalam Visual Basic .................................................. B. Variabel dalam Visual Basic ..................................................... 1. Deklarasi Variabel ................................................................ 2. Aturan Penamaan Variabel .............................................. 3. Ruang Lingkup Variabel ..................................................... C. Konstanta dalam Visual Basic .................................................. 1. Deklarasi Konstanta ............................................................. 2. Ruang Lingkup Konstanta .................................................. D. Operator ....................................................................................... 1. Operator Penugasan (assignment) .................................. ii iii vii viii 1 1 2 2 2 3 3 4 4 6 6 6 7 7 8 8 8 8 8 8 8 8 9 9 9 9 10 12 13 15 15 16 16 18 18 19 19 20 20 20STMIK PRANATA INDONESIA

3

Pemrograman Visual Basic 2. Operator Aritmatika ............................................................. 3. Operator Pembanding ....................................................... 4. Operator Logika ................................................................... E. Kontrol Program .......................................................................... 1. Pencabangan On Error ....................................................... 2. Statement End ...................................................................... 3. Komentar Program ............................................................... F. Contoh Program ......................................................................... BAB III PROPERTY, METHOD dan EVENT ..................................................... A. Memahami Property, Method dan Event ............................. 1. Properti ................................................................................... 2. Method ................................................................................... 3. Event ....................................................................................... B. Property ........................................................................................ 1. Property Name ...................................................................... 2. Property Left, Top, Width, Height ....................................... 3. Property ForeColor dan BackColor .................................. 4. Property Font ......................................................................... 5. Property Caption dan Text ................................................. 6. Property Enabled an Visible ............................................... C. Metode Umum (Common Methods) ..................................... 1. Metode Move ....................................................................... 2. Metode Refresh .................................................................... 3. Metode SetFocus ................................................................. D. Kejadian (Event) ......................................................................... E. Contoh Program ......................................................................... BAB IV KONTROL INSTRINSIK ......................................................................... A. Pengantar .................................................................................... B. Command .................................................................................... C. Label .............................................................................................. D. TextBox .......................................................................................... E. CheckBox ..................................................................................... F. Option ........................................................................................... G. Frame ............................................................................................ H. List Box ........................................................................................... I. Combo Box .................................................................................. J. Image ............................................................................................ 1. Menampilkan gambar kedalam control image ........... 2. Mengosongkan control image ......................................... 3. Menyimpan gambar dalam control image ke file ....... K. Picture Box .................................................................................... L. Scroll Bar ....................................................................................... M. Time ............................................................................................... N. DriveListBox, DirListBox, FileListBox ............................................ 1. Membatasi File pada FileListBox ....................................... 2. Menghubungkan DriveListBox, DirListBox dan FileListBox O. Common Dialog Box .................................................................. 1. Metode Common Dialog ................................................... 2. Contoh Program .........................................