I how do make a basic cash register in visual basic?
Posted on 2008-10-10
I have designed it and now need to code it but find that it does not accept my functions for calculating the net price, vat , total incl vat and then rounding this off to two decimal places also ensuring it rejects a non numeric input on the net price text box, I have a calculate btn that runs runs the functions...please advice where I'm going wrong.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim intTxtcost As Integer
Dim inttxtamount As Integer
Dim intvat As Integer
intTxtcost = CInt(TXTCOST.Text)
inttxtamount = CInt(TXTAMOUNT.Text)
intvat = intTxtcost * inttxtamount / 100 * 17.5
TXTVAT.Text = CStr(intvat)
TXTRESULT.Text = intvat + intTxtcost