

Setelah merancang tampilan
program aplikasi manometer (gambar 1) anda dapat merubah objek properti pada window
properti seperti pada tabel 4.1.
Tabel 1.
Propertie yang dirubah pada Windows Properties
Objek
|
Properti
|
Nilai
|
Form1
|
Caption
|
Manometer (Vertikal Scrool )
|
Label1
|
Caption
|
-100
|
Label2
|
Caption
|
-50
|
Label3
|
Caption
|
0
|
Label4
|
Caption
|
50
|
Label5
|
Caption
|
100
|
Label6
|
Caption
Font
|
Temperatur
20
|
Label7
|
Caption
|
Celsius
|
Label8
|
Caption
|
Farenheit
|
Label9
|
Caption
|
Reamur
|
Label10
|
Caption
|
Kelvin
|
Text1
|
Text
|
(kosongkan)
|
Text2
|
Text
|
(kosongkan)
|
Text3
|
Text
|
(kosongkan)
|
Text4
|
Text
|
(kosongkan)
|
Vertical Scrool bar
|
Max
Min
|
-100
100
|
Command1
|
Caption
|
&Keluar
|
Langkah berikutnya yaitu memasukkan
kode yang diperlukan yaitu:
- Klik ganda pada Vscroll1,
lalu ketik kode program dibawah ini.
Private Sub VScroll1_Change()
Text1.Text = Str(VScroll1.Value)
Text2.Text = (9 / 5 * Text1.Text)
+ 32
Text3.Text = 4 / 5 * Text1.Text
Text4.Text = Text1.Text + 273
End Sub
- Klik
ganda pada tombol Keluar, lalu
ketik kode program dibawah ini.
Private Sub Command1_Click()
End
End Sub
- Aplikasi program telah dapat dijalankan dengan menekan tombol F5. Apabila Vscroll digerakkan maka akan tercetak angka-angka pada kolom-kolom text yang telah tersedia dan bila di klik tombol Keluar maka program akan tertutup seperti yang terlihat pada gambar 2.
No comments:
Post a Comment