Pages - Menu

Rabu, 21 Mei 2014

Membuat Aplikasi sederhana menggunakan Visual Basic 6.0

Langkah-langkahnya :
1. Buat project baru dengan memilih standard EXE lalu klik open
2.  Tambahkan komponen-komponen Label, OptionButton, CheckButton, Text, Frame dan Command. Agar seperti gambar dibawah ini :


gambar proses ke 1

Bila menggunakan tampilan di dalam frame, maka frame harus dibuat terlebih dahulu baru komponen-komponen di dalamnya. Atur property setiap komponen seperti berikut:





object
property
nilai
Form 1
Name
Caption
Lth3
Latihan CheckBox
Label 1
Caption
Font
Entry Pembayaran Kuliah
Font : Tekton Pro
Font Style : Bold
Size : 18
Label 2
Caption
Nama Mahasiswa :
Font : Tekton Pro
Font Style : Bold
Size : 14
Label 3
Caption
Font


Besar Pembayaran :
Font : Tekton Pro
Font Style : Bold
Size : 14
Frame 1
Caption
Font
Jurusan :
Font : Sebran 3
Font Style : Oblique
Size : 10
Frame 2
Caption
Font
Tools
Font : Sebran 3
Font Style : Oblique
Size : 10
Frame 3
Caption
Font
Jenis Pembayaran :
Font : Sebran 3
Font Style : Oblique
Size : 10
Text 1
Text
Font

Size : 12
Text 2
Text
Font
Enable

Size : 12
False
Text 3
Text
Font
Enable

Size :12
False
Option 1
Caption
Font
TI
Font Style : Bold
Size : 10
Option 2
Caption
Font
SI
Font Style : Bold
Size :10
Option 3
Caption
Font
SK
Font Style : Bold
Size : 10
Check 1
Caption
Font
BPP
Font Style : Bold
Size : 8
Check 2
Caption
Font
Pembangunan
Font Style : Bold
Size :8
Check 3
Caption
Font
KKP
Font Style : Bold
Size : 8
Check 4
Caption
Font
TA
Font Style : Bold
Size : 8
Check 5
Caption
Font
Wisuda
Font Style : Bold
Size : 8
Command 1
Caption
&ULANG
Command 2
Caption
&CLOSE


Dari pengaturan ini akan dihasilkan tampilan program aplikasi seperti pada gambar di bawah ini :

gambar proses ke 2

Click pada command1, tambahkan kode program sehingga menjadi:

Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
Check5.Value = 0
Text1.SetFocus
End Sub 

pada command2, tambahkan kode program sehingga menjadi:

Private Sub Command2_Click()
Unload Me
End Sub

Click pada Option1, tambahkan kode program sehingga menjadi:

Private Sub Option1_Click()
Text2.Text = "Teknik Informatika"
End Sub

Click pada Option2, tambahkan kode program sehingga menjadi:

Private Sub Option2_Click()
Text2.Text = "Sistem Informasi"
End Sub

Click pada Option3, tambahkan kode program sehingga menjadi:

Private Sub Option3_Click()
Text2.Text = "Sistem Komputer"
End Sub

Click pada Check1, tambahkan kode program sehingga menjadi:

Private Sub Check1_Click()
Dim BPP, Pembangunan, KKP, TA, Wisuda As Single
Dim BIAYA As Long

If Check1.Value = 1 Then
BPP = 100000
Else
BPP = 0
End If
If Check2.Value = 1 Then
Pembangunan = 2000000
Else
Pembangunan = 0
End If
If Check3.Value = 1 Then
KKP = 200000
Else
KKP = 0
End If
If Check4.Value = 1 Then
TA = 100000
Else
TA = 0
End If
If Check5.Value = 1 Then
Wisuda = 500000
Else
Wisuda = 0
End If

BIAYA = BPP + Pembangunan + KKP + TA + Wisuda
Text3.Text = BIAYA
End Sub

Click pada Check2, tambahkan kode program sehingga menjadi:

Private Sub Check2_Click()
Dim BPP, Pembangunan, KKP, TA, Wisuda As Single
Dim BIAYA As Long

If Check1.Value = 1 Then
BPP = 100000
Else
BPP = 0
End If
If Check2.Value = 1 Then
Pembangunan = 2000000
Else
Pembangunan = 0
End If
If Check3.Value = 1 Then
KKP = 200000
Else
KKP = 0
End If
If Check4.Value = 1 Then
TA = 100000
Else
TA = 0
End If
If Check5.Value = 1 Then
Wisuda = 500000
Else
Wisuda = 0
End If

BIAYA = BPP + Pembangunan + KKP + TA + Wisuda
Text3.Text = BIAYA
End Sub

Click pada Check3, tambahkan kode program sehingga menjadi:

Private Sub Check3_Click()
Dim BPP, Pembangunan, KKP, TA, Wisuda As Single
Dim BIAYA As Long

If Check1.Value = 1 Then
BPP = 100000
Else
BPP = 0
End If
If Check2.Value = 1 Then
Pembangunan = 2000000
Else
Pembangunan = 0
End If
If Check3.Value = 1 Then
KKP = 200000
Else
KKP = 0
End If
If Check4.Value = 1 Then
TA = 100000
Else
TA = 0
End If
If Check5.Value = 1 Then
Wisuda = 500000
Else
Wisuda = 0
End If

BIAYA = BPP + Pembangunan + KKP + TA + Wisuda
Text3.Text = BIAYA
End Sub

Click pada Check4, tambahkan kode program sehingga menjadi:

Private Sub Check4_Click()
Dim BPP, Pembangunan, KKP, TA, Wisuda As Single
Dim BIAYA As Long

If Check1.Value = 1 Then
BPP = 100000
Else
BPP = 0
End If
If Check2.Value = 1 Then
Pembangunan = 2000000
Else
Pembangunan = 0
End If
If Check3.Value = 1 Then
KKP = 200000
Else
KKP = 0
End If
If Check4.Value = 1 Then
TA = 100000
Else
TA = 0
End If
If Check5.Value = 1 Then
Wisuda = 500000
Else
Wisuda = 0
End If

BIAYA = BPP + Pembangunan + KKP + TA + Wisuda
Text3.Text = BIAYA
End Sub

Click pada Check5, tambahkan kode program sehingga menjadi:


 

Private Sub Check5_Click()
Dim BPP, Pembangunan, KKP, TA, Wisuda As Single
Dim BIAYA As Long

If Check1.Value = 1 Then
BPP = 100000
Else
BPP = 0
End If
If Check2.Value = 1 Then
Pembangunan = 2000000
Else
Pembangunan = 0
End If
If Check3.Value = 1 Then
KKP = 200000
Else
KKP = 0
End If
If Check4.Value = 1 Then
TA = 100000
Else
TA = 0
End If
If Check5.Value = 1 Then
Wisuda = 500000
Else
Wisuda = 0
End If

BIAYA = BPP + Pembangunan + KKP + TA + Wisuda
Text3.Text = BIAYA
End Sub

Setelah melewati beberapa tahap diatas akan menghasilkan gambar seperti berikut ini :

gambar hasil akhir

0 komentar:

Posting Komentar

luvne.com ayeey.com cicicookies.com mbepp.com kumpulanrumusnya.com.com tipscantiknya.com