halow agan agan....!
mau sharring tentang program visual basic nih
hehhehe..... maaf yah klo programnya agak simpel,,,,,saya masih newbie gan....
Sebenarnya ni soal ujian les aq,,,hehe....sekedar berbagi ilmu saja...
lets cekidot
program dibawah yaitu program tentang Sistem Informasi Penjualan motor
oke seperti biasa ...sebelum buat listing programnya qt buat terlebih dahulu formnya
ok....selanjutnya listing programnya:
Option Explicit
Dim harga, pinjaman
Private Sub CB1_Click()
If CB1.ListIndex = 0 Then
harga = 0
ElseIf CB1.ListIndex = 1 Then
harga = 16000000
ElseIf CB1.ListIndex = 2 Then
harga = 14500000
ElseIf CB1.ListIndex = 3 Then
harga = 17000000
ElseIf CB1.ListIndex = 4 Then
harga = 18500000
ElseIf CB1.ListIndex = 5 Then
harga = 19000000
ElseIf CB1.ListIndex = 6 Then
harga = 13500000
ElseIf CB1.ListIndex = 7 Then
harga = 14000000
End If
txtharga = Format(harga, "Rp#,##0.00")
End Sub
Private Sub cmdclose_Click()
End
End Sub
Private Sub Form_Load()
CB1.AddItem "Pilih Kendaraan Anda"
CB1.AddItem "SupraX"
CB1.AddItem "Revo"
CB1.AddItem "Mega Pro"
CB1.AddItem "Vixion"
CB1.AddItem "Scorpio"
CB1.AddItem "Mio"
CB1.AddItem "Jupiter MX"
CB1.ListIndex = 0
End Sub
Private Sub txtlama_Change()
Dim a, b, c
a = Val(txtbunga) / 100 / 12
b = Val(txtlama) * 12
c = (pinjaman * a) / (1 - (1 + a) ^ -b)
txtcicil = c
txtcicil = Format(txtcicil, "Rp#,##0.00")
End Sub
Private Sub txtum_Change()
Dim h, pj, um As Long
h = Val(harga)
um = Val(txtum)
pj = h - um
pinjaman = pj
txtpinjam = Format(pinjaman, "Rp#,##0.00")
End Sub
finish.....maka hasilnya akan seperti inii
okk...semoga bermanfaat!
Tidak ada komentar:
Posting Komentar