Académique Documents
Professionnel Documents
Culture Documents
Pemrograman Visual
Basic 6.0
Iwan santosa, ST
What is Visual Basic?
Visual Basic is a tool that allows you to develop Windows
(Graphic User Interface - GUI) applications. The
applications have a familiar appearance to the user.
Visual Basic is event-driven, meaning code remains idle
until called upon to respond to some event (button pressing,
menu selection, ...).
Application (Project)
Forms - Windows that you create for user interface
Controls - Graphical features drawn on forms to allow user
interaction (text boxes, labels, scroll bars, command buttons, etc.)
(Forms and Controls are objects.)
Properties - Every characteristic of a form or control is specified by a
property. Example properties include names, captions, size, color,
position, and contents. Visual Basic applies default properties. You
can change properties at design time or run time.
Methods - Built-in procedure that can be invoked to impart some
action to a particular object.
Event Procedures - Code related to some object. This is the code
that is executed when a certain event occurs.
General Procedures - Code not related to objects. This code must
be invoked by the application.
Modules - Collection of general procedures, variable declarations,
and constant definitions used by application.
Kontrol Menu
Restore
Move
Size
Minimize
Maximize
Close
Lingkungan
Floating
Sizeable
Dockable
Menu
Dengan Mouse
Dengan Keyboard
Main Window
Toolbox
Project Explorer
Windows Properties
Form Layout Windows
Jendela Kode
Membuka Aplikasi Baru
Keterangan Singkat
Standart EXE
Membuat aplkasi visual basic standart (umum)
ActiveX EXE
Membuat aplikasi activeX
ActiveX DLL
Membuat Library ActiveX
activeX Control
Membuat kontrol activeX
VB Application Wizard
Membuat aplikasi VB dengan bantuan wizard
VB Wizard Manager
IPusat Pengelolaan Wizard Visual Basic
IIS Aplication
Membuat aplikasi IIS (Internet Information Server)
DHTML Application
Membuat aplikasi DHTML
Membuka Aplikasi Yang Sudah
ada
Alur Program VB
EVENT
USER SYSTEM
PROSES
METODE
HASIL
Bagian Kode
APLIKASI VB
KODE KONTROL
KODE KONTROL
KODE FORM
KODE MODUL
Structure of a Visual Basic
Application
Penggunaan jendela Kode
Arti Warna text Pada Umumnya
Biru
Text ini merupakan kata kunci (reserved word)
Hijau
Text ini merupakan keterangan
Hitam
Tulisan biasa (kode, nama variabel dan yang lainnya)
Merah
Kode program yang salah
Bantuan Pada jendela kode
Tool Tips
Otomasi variabel
Jendela Attribut
Data, Variabel dan Konstanta
Type Data
Integer
Type data berupa bilangan bulat (-32.768 – 32.767)
Byte
Decimal
String
Single
Double
Date
Currency
Long
Object
Varinant
Variabel
Merupakan tempat penyimpanan sementara
VARIABEL
Proses Pergantian Nilai Variabel
Si Usrok
USER
Si Usrok
Si Unyil
METODE
Si Usrok Si Unyil
Deklarasi Variabel
Variabel dideklarasikan dengan Dim
Sintaksnya
Dim namavariabel As Type Data
Contoh
Dim Nama As String
Dim No As Integer
Dim TglLahir As Date
Variabel Global dan Local
Variabel Global : variabel yang dapat diakses
dari semua lokasi di dalam program.
Contoh
PUBLIC Counter As Integer (Pendeklarasian di
Jendela modul kode)
Variabel Lokal : variabel yang hanya dapat
digunakan di lingkungannya sendiri.
Contoh
Pendeklarasian variabel di dalam event
Pemberian Nama Variabel
Nama Tipe Data Awalan Contoh
diberikan
untuk
memperjelas Boolean Bln BlnStatus
kegunaan
variabel
Integer Int IntTotal
tersebut