download

Matakuliah
Tahun
Versi
: T0063/Pemrograman Visual
: 2005
: 1/0
Pertemuan 06
Control Object
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• Mendemonstrasikan penggunaan Control
Object dan propertinya (C3)
2
Outline Materi
Control Object
• Jenis Jenis Control Object
• Characteristic
• Properties
• Event
• Method
3
Control Object
Object :
• Characteristics
• Properties
• Events
• Methods
Name sebenarnya bukan property tapi
sebagai identifier setiap object, sebelum
menggunakan control object sebaiknya
sesuaikan namanya, disamping nama
standar. Berlaku untuk semua control object
berikut ini.
4
Control Object
• TextBox
• Characteristics
– Input text pada saat run time
• Properties
– Text
• Text merupakan property Default bagi TextBox
• Text merupakan property penampung karakter yang diinput
oleh pengguna saat run time
• Events
– Change
– Keypress
• Methods
– SetFocus
5
Control Object
• Label
• Characteristics
– Digunakan sebagai object tampilan bagi pengguna
– Bersifat decorative output
– Jarang digunakan sebagai programmable object
• Properties
– Caption
• Events
– Change
• Methods
– Refresh
6
Control Object
• Frame
• Characteristics
– Merupakan container bagi object yang lain
– Bersifat decorative output
• Properties
– Caption
• Events
– DragDrop
• Methods
– Refresh
7
Control Object
• CommandButton
• Characteristics
– Digunakan sebagai trigger (pemicu) yang berupa
tombol untuk menjalankan proses
• Properties
– Caption
• Events
– Click / DoubleClick
• Methods
– SetFocus
8
Control Object
• CheckBox
• Characteristics
– Digunakan untuk memilih banyak diantara banyak
pilihan
– Bersifat input
• Properties
– Caption
– Value
• Events
– Click
• Methods
– SetFocus
9
Control Object
• OptionButton
• Characteristics
– Radio Button
– Digunakan untuk memilih satu diantara banyak pilihan
– Bersifat input
• Properties
– Caption
– Value
• Events
– Click
• Methods
– SetFocus
10
Control Object
• ListBox
•
Characteristics
–
–
•
Properties
–
–
–
–
–
–
–
•
List
ListCount
ListIndex
ItemData
Selected
MultiSelect
Style (Standard / CheckBox)
Events
–
–
•
Digunakan untuk menampilkan daftar data secara jamak
Bersifat input output
Click / Double Click
Scroll
Methods
–
–
–
–
–
AddItem
Clear
RemoveItem
Refresh
SetFocus
11
Control Object
• ComboBox
•
Characteristics
–
–
•
Properties
–
–
–
–
–
–
•
List
ListCount
ListIndex
ItemData
Selected
MultiSelect
Events
–
–
–
•
Digunakan untuk melakukan pemilihan tunggal terhadap data jamak
Bersifat input output
Change
Click / Double Click
KeyPress
Methods
–
–
–
–
–
AddItem
Clear
RemoveItem
Refresh
SetFocus
12
Control Object
•
•
PictureBox
Characteristics
– Digunakan untuk menampilkan gambar (BMP,GIF,JPG,ICO)
– Bersifat output (bisa digunakan untuk efek gambar, zoom, fading, flipping, dll )
•
Properties
– Picture (dengan fungsi LoadPicture)
– AutoSize
•
Events
–
–
–
–
–
•
Change
Click / Double Click
GotFocus / LostFocus
Paint
Resize
Methods
– Cls
– Refresh
– PaintPicture
13
Control Object
• Image
• Characteristics
– Digunakan untuk menampilkan gambar
– Bersifat output
– Lebih sederhana dari PictureBox
• Properties
– Picture
– Stretch
• Events
–
–
–
–
–
Change
Click / Double Click
GotFocus / LostFocus
Paint
Resize
• Methods
– Refresh
14