1. Forms
- FrmBilling(FrmBilling.frm)
- frmHelp(frmHelp.frm)
- FrmMenu(FrmMenu.frm)
- frmSplash(frmSplash.frm)
--------------------------------------------------------------------------------------------------
1. Forms
- FrmBilling
Script Code :
Private Sub CekRental_Click()
CekSendiri.Enabled = False
End Sub
-----------------------------------------------------------------------------------------
Private Sub CekSendiri_Click()
CekRental.Enabled = False
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdBilUlang_Click()
DTPickTgl.Enabled = False
CmdMasuk.Enabled = False
TxtMasuk.Text = ""
TxtMasuk.Enabled = False
CmdKeluar.Enabled = False
TxtKeluar.Text = ""
TxtKeluar.Enabled = False
CmdLama.Enabled = False
TxtLama.Text = ""
TxtLama.Enabled = False
OptYa.Value = False
OptTidak.Value = False
OptYa.Enabled = False
OptTidak.Enabled = False
CekSendiri.Value = 0
CekRental.Value = 0
CekSendiri.Enabled = False
CekRental.Enabled = False
TxtPrint.Text = ""
TxtPrint.Enabled = False
txtTotal.Text = ""
txtTotal.Enabled = False
CmdHitung.Enabled = False
CmdBilUlang.Enabled = False
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdHitung_Click()
Dim lama_rental As Integer
Dim kertas As Integer
Dim banyak_print As Integer
lama_rental = TxtLama.Text
biaya_rental = (lama_rental / 60) * 1000
If CekRental.Value = Checked Then
kertas = 300
Else
kertas = 200
End If
banyak_print = TxtPrint.Text
biaya_print = banyak_print * kertas
txtTotal.Text = biaya_rental + biaya_print
txtTotal.Text = Format(txtTotal.Text, "Rp ###,###,###")
CmdBilUlang.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdKeluar_Click()
TxtKeluar.Enabled = True
TxtKeluar.Text = Time
CmdLama.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdLama_Click()
TxtLama.Enabled = True
TxtLama.Text = DateDiff("n", TxtMasuk.Text, TxtKeluar.Text)
OptYa.Enabled = True
OptTidak.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdMasuk_Click()
TxtMasuk.Enabled = True
TxtMasuk.Text = Time
CmdKeluar.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub ComHari_Change()
If ComHari.Text = "Senin" Or ComHari.Text = "Selasa" Or ComHari.Text = "Rabu" Or ComHari.Text = "Kamis" Or ComHari.Text = "Jumat" Or ComHari.Text = "Sabtu" Or ComHari.Text = "Minggu" Then
CmdMasuk.Enabled = True
DTPickTgl.Enabled = True
Else
X = MsgBox("Nama hari yang Anda isi Salah !!! Silahkan memilih dari daftar yang telah tersedia", vbOKOnly, "Nama Hari Salah")
ComHari.SetFocus
End If
End Sub
-----------------------------------------------------------------------------------------
Private Sub ComHari_DropDown()
CmdMasuk.Enabled = True
DTPickTgl.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub ComHari_KeyDown(KeyCode As Integer, Shift As Integer)
CmdMasuk.Enabled = True
DTPickTgl.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub Form_Load()
FrmBilling.Top = 0
FrmBilling.Left = 0
DTPickTgl.Enabled = False
CmdMasuk.Enabled = False
CmdKeluar.Enabled = False
CmdLama.Enabled = False
OptYa.Enabled = False
OptTidak.Enabled = False
CekSendiri.Enabled = False
CekRental.Enabled = False
TxtPrint.Enabled = False
txtTotal.Enabled = False
CmdHitung.Enabled = False
CmdBilUlang.Enabled = False
End Sub
-----------------------------------------------------------------------------------------
Private Sub Image1_Click()
FrmBilling.Hide
End Sub
-----------------------------------------------------------------------------------------
Private Sub OptTidak_Click()
CekSendiri.Enabled = False
CekRental.Enabled = False
TxtPrint.Text = "0"
TxtPrint.Enabled = False
CmdHitung.Enabled = True
CmdHitung.Default = True
CmdBilUlang.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub OptYa_Click()
OptTidak.Enabled = False
CekSendiri.Enabled = True
CekRental.Enabled = True
TxtPrint.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub TxtPrint_Change()
CmdHitung.Enabled = True
End Sub
CekSendiri.Enabled = False
End Sub
-----------------------------------------------------------------------------------------
Private Sub CekSendiri_Click()
CekRental.Enabled = False
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdBilUlang_Click()
DTPickTgl.Enabled = False
CmdMasuk.Enabled = False
TxtMasuk.Text = ""
TxtMasuk.Enabled = False
CmdKeluar.Enabled = False
TxtKeluar.Text = ""
TxtKeluar.Enabled = False
CmdLama.Enabled = False
TxtLama.Text = ""
TxtLama.Enabled = False
OptYa.Value = False
OptTidak.Value = False
OptYa.Enabled = False
OptTidak.Enabled = False
CekSendiri.Value = 0
CekRental.Value = 0
CekSendiri.Enabled = False
CekRental.Enabled = False
TxtPrint.Text = ""
TxtPrint.Enabled = False
txtTotal.Text = ""
txtTotal.Enabled = False
CmdHitung.Enabled = False
CmdBilUlang.Enabled = False
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdHitung_Click()
Dim lama_rental As Integer
Dim kertas As Integer
Dim banyak_print As Integer
lama_rental = TxtLama.Text
biaya_rental = (lama_rental / 60) * 1000
If CekRental.Value = Checked Then
kertas = 300
Else
kertas = 200
End If
banyak_print = TxtPrint.Text
biaya_print = banyak_print * kertas
txtTotal.Text = biaya_rental + biaya_print
txtTotal.Text = Format(txtTotal.Text, "Rp ###,###,###")
CmdBilUlang.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdKeluar_Click()
TxtKeluar.Enabled = True
TxtKeluar.Text = Time
CmdLama.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdLama_Click()
TxtLama.Enabled = True
TxtLama.Text = DateDiff("n", TxtMasuk.Text, TxtKeluar.Text)
OptYa.Enabled = True
OptTidak.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdMasuk_Click()
TxtMasuk.Enabled = True
TxtMasuk.Text = Time
CmdKeluar.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub ComHari_Change()
If ComHari.Text = "Senin" Or ComHari.Text = "Selasa" Or ComHari.Text = "Rabu" Or ComHari.Text = "Kamis" Or ComHari.Text = "Jumat" Or ComHari.Text = "Sabtu" Or ComHari.Text = "Minggu" Then
CmdMasuk.Enabled = True
DTPickTgl.Enabled = True
Else
X = MsgBox("Nama hari yang Anda isi Salah !!! Silahkan memilih dari daftar yang telah tersedia", vbOKOnly, "Nama Hari Salah")
ComHari.SetFocus
End If
End Sub
-----------------------------------------------------------------------------------------
Private Sub ComHari_DropDown()
CmdMasuk.Enabled = True
DTPickTgl.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub ComHari_KeyDown(KeyCode As Integer, Shift As Integer)
CmdMasuk.Enabled = True
DTPickTgl.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub Form_Load()
FrmBilling.Top = 0
FrmBilling.Left = 0
DTPickTgl.Enabled = False
CmdMasuk.Enabled = False
CmdKeluar.Enabled = False
CmdLama.Enabled = False
OptYa.Enabled = False
OptTidak.Enabled = False
CekSendiri.Enabled = False
CekRental.Enabled = False
TxtPrint.Enabled = False
txtTotal.Enabled = False
CmdHitung.Enabled = False
CmdBilUlang.Enabled = False
End Sub
-----------------------------------------------------------------------------------------
Private Sub Image1_Click()
FrmBilling.Hide
End Sub
-----------------------------------------------------------------------------------------
Private Sub OptTidak_Click()
CekSendiri.Enabled = False
CekRental.Enabled = False
TxtPrint.Text = "0"
TxtPrint.Enabled = False
CmdHitung.Enabled = True
CmdHitung.Default = True
CmdBilUlang.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub OptYa_Click()
OptTidak.Enabled = False
CekSendiri.Enabled = True
CekRental.Enabled = True
TxtPrint.Enabled = True
End Sub
-----------------------------------------------------------------------------------------
Private Sub TxtPrint_Change()
CmdHitung.Enabled = True
End Sub
Script Code :
Option Explicit
-----------------------------------------------------------------------------------------
Private Sub CmdOk_Click()
Unload Me
End Sub
-----------------------------------------------------------------------------------------
Private Sub Form_Resize()
CmdOk.Move (Me.ScaleWidth - CmdOk.Width) / 2, Me.ScaleHeight - CmdOk.Height - 120
txtHelp.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight - CmdOk.Height - 240
End Sub
-----------------------------------------------------------------------------------------
Private Sub txtHelp_Click()
CmdOk.SetFocus
End Sub
-----------------------------------------------------------------------------------------
Private Sub CmdOk_Click()
Unload Me
End Sub
-----------------------------------------------------------------------------------------
Private Sub Form_Resize()
CmdOk.Move (Me.ScaleWidth - CmdOk.Width) / 2, Me.ScaleHeight - CmdOk.Height - 120
txtHelp.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight - CmdOk.Height - 240
End Sub
-----------------------------------------------------------------------------------------
Private Sub txtHelp_Click()
CmdOk.SetFocus
End Sub
Script Code :
Private Sub MnuBantu_Click()
frmHelp.Show
End Sub
-----------------------------------------------------------------------------------------
Private Sub MnuInputBil_Click()
FrmBilling.Show
End Sub
-----------------------------------------------------------------------------------------
Private Sub TmrAnimasi_Timer()
FrmMenu.Caption = Right(FrmMenu.Caption, Len(FrmMenu.Caption) - 1) & Left(FrmMenu.Caption, 1)
End Sub
-----------------------------------------------------------------------------------------
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "ToolBilling"
FrmBilling.Show
Case "ToolHelp"
frmHelp.Show
Case "ToolExit"
End
End Select
End Sub
frmHelp.Show
End Sub
-----------------------------------------------------------------------------------------
Private Sub MnuInputBil_Click()
FrmBilling.Show
End Sub
-----------------------------------------------------------------------------------------
Private Sub TmrAnimasi_Timer()
FrmMenu.Caption = Right(FrmMenu.Caption, Len(FrmMenu.Caption) - 1) & Left(FrmMenu.Caption, 1)
End Sub
-----------------------------------------------------------------------------------------
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "ToolBilling"
FrmBilling.Show
Case "ToolHelp"
frmHelp.Show
Case "ToolExit"
End
End Select
End Sub
Script Code :
Option Explicit
-----------------------------------------------------------------------------------------
Private Sub Form_Click()
animasilayar
Unload Me
FrmMenu.Show
End Sub
-----------------------------------------------------------------------------------------
Private Sub Form_KeyPress(KeyAscii As Integer)
animasilayar
Unload Me
FrmMenu.Show
End Sub
-----------------------------------------------------------------------------------------
Sub animasilayar()
Dim i As Integer
i = Me.Height
While i >= frmSplash.Height
i = i - 110
If i < frmSplash.Height Then
Me.Height = i
Else
Me.Height = frmSplash.Height
End If
DoEvents
Wend
i = Me.Top
i = Me.Top
While i > 0
Me.Move Me.Left, i, Me.Width, Me.Height
i = i - 330
DoEvents
Wend
i = Me.Left
While i < Screen.Width
Me.Move i, Me.Top + 135, Me.Width, Me.Height
i = i + 335
DoEvents
Wend
End Sub
-----------------------------------------------------------------------------------------
Private Sub Form_Click()
animasilayar
Unload Me
FrmMenu.Show
End Sub
-----------------------------------------------------------------------------------------
Private Sub Form_KeyPress(KeyAscii As Integer)
animasilayar
Unload Me
FrmMenu.Show
End Sub
-----------------------------------------------------------------------------------------
Sub animasilayar()
Dim i As Integer
i = Me.Height
While i >= frmSplash.Height
i = i - 110
If i < frmSplash.Height Then
Me.Height = i
Else
Me.Height = frmSplash.Height
End If
DoEvents
Wend
i = Me.Top
i = Me.Top
While i > 0
Me.Move Me.Left, i, Me.Width, Me.Height
i = i - 330
DoEvents
Wend
i = Me.Left
While i < Screen.Width
Me.Move i, Me.Top + 135, Me.Width, Me.Height
i = i + 335
DoEvents
Wend
End Sub
Terima kasih, semoga bermanfaat!