EnglishFrenchGermanSpainItalian DutchRussianPortugueseJapaneseKorean

Google Search

Custom Search

Monday, November 21, 2011

Latihan Membuat Aplikasi Hotel dengan VB 6.0



kode programnnya:

Sub nonaktif()
txtnama.Enabled = False
txtjenis.Enabled = False
txtharga.Enabled = False
txtlama.Enabled = False
txtbayar.Enabled = False
txtdiskon.Enabled = False
txttobay.Enabled = False
txtubay.Enabled = False
txtukem.Enabled = False
cmbkode.Enabled = False
End Sub

Sub aktif()
txtnama.Enabled = True
txtjenis.Enabled = True
txtharga.Enabled = True
txtlama.Enabled = True
txtbayar.Enabled = True
txtdiskon.Enabled = True
txttobay.Enabled = True
txtubay.Enabled = True
txtukem.Enabled = True
cmbkode.Enabled = True
End Sub

Sub bersih()
txtnama.Text = ""
txtjenis.Text = ""
txtharga.Text = ""
txtlama.Text = ""
txtbayar.Text = ""
txtdiskon.Text = ""
txttobay.Text = ""
txtubay.Text = ""
txtukem.Text = ""
cmbkode.Text = ""
End Sub

Private Sub cmbkode_Click()
If cmbkode.Text = "001" Then
txtjenis.Text = "VIP"
txtharga.Text = "350000"
ElseIf cmbkode.Text = "002" Then
txtjenis.Text = "Deluxe"
txtharga.Text = "250000"
Else
txtjenis.Text = "Standart"
txtharga.Text = "150000"
End If
txtlama.SetFocus
End Sub

Private Sub cmdbersih_Click()
aktif
bersih
txtnama.SetFocus
End Sub

Private Sub cmdhitung_Click()
txtbayar.Text = Val(txtharga) * Val(txtlama)
If txtbayar.Text >= 500000 Then
txtdiskon = Val(txtbayar) * 0.1
txttobay.Text = Val(txtbayar) - Val(txtdiskon)
End If
txtubay.SetFocus
End Sub

Private Sub cmdkeluar_Click()
x = MsgBox("Are You Sure To Quit ?", vbQuestion + vbOKCancel, "Konfirmation")
If x = vbOK Then
End
End If
End Sub

Private Sub Form_Activate()
nonaktif
bersih
cmdbersih.SetFocus
End Sub

Private Sub Form_Load()
cmbkode.AddItem "001"
cmbkode.AddItem "002"
cmbkode.AddItem "003"
End Sub

Private Sub Timer1_Timer()
lbltanggal.Caption = Format(Date, "dddd / mmmm / yyyy")
lbljam.Caption = Format(Time, "hh : mm : ss")
End Sub

Private Sub txtlama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdhitung.SetFocus
End If
End Sub

Private Sub txtubay_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtukem.Text = Val(txtubay) - Val(txttobay)
nonaktif
cmdbersih.SetFocus
End If
End Sub


source: http://diashachimkeribetan.blogspot.com/

Masukkan Code ini K1-EY8895-E
untuk berbelanja di KutuKutuBuku.com