Minggu, 23 Oktober 2011

Program Visual Basic Penjualan Tiket Pesawat Terbang

Posted by Unknown On Minggu, Oktober 23, 2011 | No comments

Sintaknya :


Sub nonaktif()
txtnama.Enabled = False
txttelp.Enabled = False
cmbkode.Enabled = False
List1.Enabled = False
txtmaskapai.Enabled = False
txttujuan.Enabled = False
txtjam.Enabled = False
txtbonus.Enabled = False
txtharga.Enabled = False
txtjumbel.Enabled = False
txttotal.Enabled = False
txtcash.Enabled = False
txtkembali.Enabled = False
End Sub

Sub aktif()
txtnama.Enabled = True
txttelp.Enabled = True
cmbkode.Enabled = True
List1.Enabled = True
txtmaskapai.Enabled = True
txttujuan.Enabled = True
txtjam.Enabled = True
txtbonus.Enabled = True
txtharga.Enabled = True
txtjumbel.Enabled = True
txttotal.Enabled = True
txtcash.Enabled = True
txtkembali.Enabled = True
End Sub

Private Sub Timer1_Timer()
waktu = Format(Time, "hh:mm:ss")
tanggal = Format(Date, "dddd,d mmmm yyyy")
Label1.Left = Label1.Left - 30
If Label1.Left < -6000 Then
Label1.Left = 12000
If Label1.ForeColor = vbRed Then
Label1.ForeColor = vbGreen
Label1.ForeColor = vbBlack
Label1.ForeColor = vbBlue
Else
Label1.ForeColor = vbRed
End If
End If
End Sub

Private Sub KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
aktif
End Sub

Private Sub Form_Activate()
nonaktif
cmbkode = "--Pilih Kode--"
cmbkode.AddItem "GDI"
cmbkode.AddItem "AKI"
cmbkode.AddItem "SJA"
cmbkode.AddItem "BTV"
List1.AddItem "Pagi"
List1.AddItem "Siang"
List1.AddItem "Sore"
List1.AddItem "Malam"
cmdlagi.SetFocus
End Sub

Private Sub cmbkode_Click()
If cmbkode.Text = "GDI" Then
txtmaskapai.Text = "Garuda Indonesia"
txttujuan.Text = "Jakarta - Bali"
txtharga.Text = 1200000
ElseIf cmbkode.Text = "AKI" Then
txtmaskapai.Text = "Air Asia"
txttujuan.Text = "Jakarta - Singapore"
txtharga.Text = 2500000
ElseIf cmbkode.Text = "SJA" Then
txtmaskapai.Text = "Sriwijaya Air"
txttujuan.Text = "Jakarta - Jogjakarta"
txtharga.Text = 650000
ElseIf cmbkode.Text = "BTV" Then
txtmaskapai.Text = "Batavia Air"
txttujuan.Text = "Jakarta - Makassar"
txtharga.Text = 800000
End If
txtmaskapai.Enabled = False
txttujuan.Enabled = False
txtharga.Enabled = False
List1.SetFocus
End Sub

Private Sub List1_Click()
If cmbkode.Text = "GDI" Then
ElseIf List1.Text = "Pagi" Then
txtjam.Text = "06.00 WIB"
txtbonus.Text = "Aneka Pilihan Sarapan Pagi Nusantara"
ElseIf List1.Text = "Siang" Then
txtjam.Text = "11.00 WIB"
txtbonus.Text = "Makan Siang + Snack"
ElseIf List1.Text = "Sore" Then
txtjam.Text = "17.45 WIB"
txtbonus.Text = "Snack + Soft Drink"
ElseIf List1.Text = "Malam" Then
txtjam.Text = "20.00"
txtbonus.Text = "Pilihan Makan Malam"
End If
If cmbkode.Text = "AKI" Then
ElseIf List1.Text = "Pagi" Then
txtjam.Text = "07.15 WIB"
txtbonus.Text = "Sarapan Pagi"
ElseIf List1.Text = "Siang" Then
txtjam.Text = "11.45 WIB"
txtbonus.Text = "Makan Siang"
ElseIf List1.Text = "Sore" Then
txtjam.Text = "16.45 WIB"
txtbonus.Text = "Snack + Teh Hangat"
ElseIf List1.Text = "Malam" Then
txtjam.Text = "19.00 WIB"
txtbonus.Text = "Makan Malam"
End If
If cmbkode.Text = "SJA" Then
ElseIf List1.Text = "Pagi" Then
txtjam.Text = "05.15 WIB"
txtbonus.Text = "Sarapan Pagi"
ElseIf List1.Text = "Siang" Then
txtjam.Text = "12.45 WIB"
txtbonus.Text = "Snack + Soft Drink"
ElseIf List1.Text = "Sore" Then
txtjam.Text = "18.45 WIB"
txtbonus.Text = "Snack + Teh Hangat"
ElseIf List1.Text = "Malam" Then
txtjam.Text = "21.00 WIB"
txtbonus.Text = "Makan Malam"
End If
If cmbkode.Text = "BTV" Then
ElseIf List1.Text = "Pagi" Then
txtjam.Text = "06.30 WIB"
txtbonus.Text = "Sarapan Pagi"
ElseIf List1.Text = "Siang" Then
txtjam.Text = "12.15 WIB"
txtbonus.Text = "Snack"
ElseIf List1.Text = "Sore" Then
txtjam.Text = "16.00 WIB"
txtbonus.Text = "Snack + Teh Hangat"
ElseIf List1.Text = "Malam" Then
txtjam.Text = "20.30 WIB"
txtbonus.Text = "Makan Malam + Snack"
End If
txtjam.Enabled = False
txtbonus.Enabled = False
txtjumbel.SetFocus
End Sub

Private Sub txtjumbel_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = Val(txtharga.Text) * Val(txtjumbel.Text)
End If
txttotal.Enabled = False
End Sub

Private Sub txtcash_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtkembali = Val(txtcash.Text) - Val(txttotal.Text)
nonaktif
End If
End Sub

Private Sub cmdlagi_Click()
aktif
cmbkode = "--Pilih Kode--"
txtnama.Text = " "
txttelp.Text = " "
List1.ListIndex = -1
txtmaskapai.Text = " "
txttujuan.Text = " "
txtjam.Text = " "
txtbonus.Text = " "
txtharga.Text = " "
txtjumbel.Text = " "
txttotal.Text = " "
txtcash.Text = " "
txtkembali.Text = " "
txtnama.SetFocus
End Sub

Private Sub cmdexit_Click()
X = MsgBox("Are Your Sure To Exit?", vbQuestion + vbYesNoCancel, "Konfirmasi")
If X = vbYes Then
End
End If
End Sub

0 komentar:

Posting Komentar

Blog Archive

Blogroll