酷祥資訊部落格

關於部落格
遊戲、資訊
  • 88289

    累積人氣

  • 2

    今日人氣

    0

    訂閱人氣

vb找零錢系統

Dim n500, n100, n50, n10, n5, n1
Dim amt, chang

Private Sub Form_Activate()
txtQty.SetFocus
End Sub

Private Sub Form_Load()

txtItemNane = "可樂"
txtPrice.Text = 26
txtQty.Text = 0
txtPay.Text = 0
End Sub

Private Sub txtPay_Change()
amt = Val(txtPrice.Text) * Val(txtQty.Text)
txtSum.Text = amt
txtChange.Text = Val(txtPay.Text) - amt
Change = txtChange.Text
n500 = Change 500
Change = Change Mod 500
n100 = Change 100
Change = Change Mod 100
n50 = Change 50
Change = Change Mod 50
n10 = Change 10
Change = Change Mod 10
n5 = Change 5
Change = Change Mod 5
lbl500.Caption = n500
lbl100.Caption = n100
lbl50.Caption = n50
lbl10.Caption = n10
lbl5.Caption = n5
lbl1.Caption = Change

End Sub

Private Sub txtQty_Change()
amt = Val(txtPrice.Text) * Val(txtQty.Text)
txtSum.Text = amt
txtChange.Text = Val(txtPay.Text) - amt
Change = txtChange.Text
n500 = Change 500
Change = Change Mod 500
n100 = Change 100
Change = Change Mod 100
n50 = Change 50
Change = Change Mod 50
n10 = Change 10
Change = Change Mod 10
n5 = Change 5
Change = Change Mod 5
lbl500.Caption = n500
lbl100.Caption = n100
lbl50.Caption = n50
lbl10.Caption = n10
lbl5.Caption = n5
lbl1.Caption = Change

End Sub

檔案下載


相簿設定
標籤設定
相簿狀態