Private Sub Chkalpukat_Click()
'jika chkalpukat dicheck
If Chkalpukat.Value = 1 Then
'maka muncul value lblminuman
Lblminuman.Caption = 4000 + Val(Lblminuman)
Else
'jika chkalpukat dicheck lagi
If Chkalpukat.Value = 1 Then
'fokus pada chkalpukat
Chkalpukat.SetFocus
Else
Lblminuman.Caption = Lblminuman.Caption - 4000
End If
End If
End Sub
Private Sub Chkayam_Click()
'jika chkayam dicheck
If Chkayam.Value = 1 Then
'maka muncul value lblharga
Lblharga.Caption = 7500 + Val(Lblharga)
Else
'jika chkayam dicheck lagi
If Chkayam.Value = 1 Then
'fokus pada chkteh
Chkrawon.SetFocus
Else
Lblharga.Caption = Lblharga.Caption - 7500
End If
End If
End Sub
Private Sub Chkjeruk_Click()
'jika chkjeruk dicheck
If Chkjeruk.Value = 1 Then
'maka muncul value lblminuman
Lblminuman.Caption = 3000 + Val(Lblminuman)
Else
'jika chkjeruk dicheck lagi
If Chkjeruk.Value = 1 Then
'fokus pada chkjeruk
Chkjeruk.SetFocus
Else
Lblminuman.Caption = Lblminuman.Caption - 3000
End If
End If
End Sub
Private Sub Chkliwet_Click()
'jika chkliwet dicheck
If Chkliwet.Value = 1 Then
'maka muncul value lblharga
Lblharga.Caption = 6500 + Val(Lblharga)
Else
'jika chkliwet dicheck lagi
If Chkliwet.Value = 1 Then
'fokus pada chkteh
Chkliwet.SetFocus
Else
Lblharga.Caption = Lblharga.Caption - 6500
End If
End If
End Sub
Private Sub Chkmelon_Click()
'jika chkmelon dicheck
If Chkmelon.Value = 1 Then
'maka muncul value lblminuman
Lblminuman.Caption = 3500 + Val(Lblminuman)
Else
'jika chkmelon dicheck lagi
If Chkmelon.Value = 1 Then
'fokus pada chkmelon
Chkmelon.SetFocus
Else
Lblminuman.Caption = Lblminuman.Caption - 3500
End If
End If
End Sub
Private Sub Chkpecel_Click()
'jika chkpecel dicheck
If Chkpecel.Value = 1 Then
'maka muncul value lblharga
Lblharga.Caption = 5000 + Val(Lblharga)
Else
'jika chkpecel dicheck lagi
If Chkpecel.Value = 1 Then
'fokus pada chkteh
Chkpecel.SetFocus
Else
Lblharga.Caption = Lblharga.Caption - 5000
End If
End If
End Sub
Private Sub Chkrawon_Click()
'jika chkrawon dicheck
If Chkrawon.Value = 1 Then
'maka muncul value lblharga
Lblharga.Caption = 6000 + Val(Lblharga)
Else
'jika chkrawon dicheck lagi
If Chkrawon.Value = 1 Then
'fokus pada chkteh
Chkrawon.SetFocus
Else
Lblharga.Caption = Lblharga.Caption - 6000
End If
End If
End Sub
Private Sub Chkteh_Click()
'jika chkteh dicheck
If Chkteh.Value = 1 Then
'maka muncul value lblminuman
Lblminuman.Caption = 1500 + Val(Lblminuman)
Else
'jika chkteh dicheck lagi
If Chkteh.Value = 1 Then
'fokus pada chkteh
Chkteh.SetFocus
Else
Lblminuman.Caption = Lblminuman.Caption - 1500
End If
End If
End Sub
Private Sub CmdBayar_Click()
TxtTotal = Val(Lblharga.Caption) + Val(Lblminuman.Caption)
Txtbayar.SetFocus
End Sub
Private Sub CmdReset_Click()
TxtTotal.Text = ""
Chkpecel.Value = 0
Chkayam.Value = 0
Chkrawon.Value = 0
Chkliwet.Value = 0
Chkteh.Value = 0
Chkjeruk.Value = 0
Chkmelon.Value = 0
Chkalpukat.Value = 0
Lblharga.Caption = "Harga"
Lblminuman.Caption = "Harga"
Txtbayar.Text = ""
Txtsisa.Text = ""
End Sub
Private Sub Txtbayar_change()
Txtsisa.Text = Val(Txtbayar.Text) - Val(TxtTotal.Text)
End Sub