Im just curious what is wrong in my code, when i click the void button an error is shown, but it runs smoothly when the void button is not click. Here is my code, thanks for your help guys!
Public Class Pizza
Private Sub rdPrimo_CheckedChanged(sender As Object, e As EventArgs) Handles rdPrimo.CheckedChanged
If rdPrimo.Checked = True Then
cbBacon.Checked = True
cbCheese.Checked = True
cbGroundBeef.Checked = False
cbMushroom.Checked = False
cbOnion.Checked = True
cbPepper.Checked = False
cbSalami.Checked = False
cbTomato.Checked = False
txtPizza.Text = "Primo"
txtPrice.Text = "185"
txtQty.Text = "1"
txtVat.Text = (".12")
Convert.ToDouble(txtPrice.Text)
Convert.ToDouble(txtVat.Text)
txtVat.Text = txtPrice.Text * 0.12
txtTotal.Text = Val(txtPrice.Text)
End If
End Sub
Private Sub rdSpecial_CheckedChanged(sender As Object, e As EventArgs) Handles rdSpecial.CheckedChanged
If rdSpecial.Checked = True Then
cbBacon.Checked = True
cbCheese.Checked = True
cbGroundBeef.Checked = False
cbMushroom.Checked = False
cbOnion.Checked = True
cbPepper.Checked = True
cbSalami.Checked = False
cbTomato.Checked = False
txtPizza.Text = "Special"
txtPrice.Text = "250"
Convert.ToDouble(txtPrice.Text)
Convert.ToDouble(txtVat.Text)
txtVat.Text = txtPrice.Text * 0.12
txtTotal.Text = Val(txtPrice.Text)
End If
End Sub
Private Sub rdDeluxe_CheckedChanged(sender As Object, e As EventArgs) Handles rdDeluxe.CheckedChanged
If rdDeluxe.Checked = True Then
cbBacon.Checked = True
cbCheese.Checked = True
cbGroundBeef.Checked = True
cbMushroom.Checked = True
cbOnion.Checked = True
cbPepper.Checked = True
cbSalami.Checked = True
cbTomato.Checked = True
txtPizza.Text = "Deluxe"
txtPrice.Text = "300"
Convert.ToDouble(txtPrice.Text)
Convert.ToDouble(txtVat.Text)
txtVat.Text = txtPrice.Text * 0.12
txtTotal.Text = Val(txtPrice.Text)
End If
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Me.Close()
MsgBox("Thank You!")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnVoid.Click
cbBacon.Checked = False
cbCheese.Checked = False
cbGroundBeef.Checked = False
cbMushroom.Checked = False
cbOnion.Checked = False
cbPepper.Checked = False
cbSalami.Checked = False
cbTomato.Checked = False
txtPizza.Text = ""
txtPrice.Text = ""
txtVat.Text = ""
rdPrimo.Checked = False
rdSpecial.Checked = False
rdDeluxe.Checked = False
txtQty.Text = ""
txtTotal.Text = ""
txtAmount.Text = ""
txtChange.Text = ""
End Sub
Dim origvalue As Double
Dim neworder As Double
Dim newval
Dim newprice
Private Sub txtVat_onChanged(sender As Object, e As EventArgs) Handles txtVat.TextChanged
If txtQty.Text = "" Then Exit Sub
If (Val(txtQty.Text) >= 1) Then
origvalue = Double.Parse(txtPrice.Text)
neworder = Double.Parse(txtQty.Text)
newval = origvalue * (neworder)
newprice = newval.ToString()
End If
End Sub
Private Sub btnEnter_Click(sender As Object, e As EventArgs) Handles btnEnter.Click
txtTotal.Text = Val(txtPrice.Text) * Double.Parse(Val(txtQty.Text))
txtVat.Text = Val(txtVat.Text) * Double.Parse(txtQty.Text)
btnEnter.Visible = False
End Sub
Private Sub txtQty_onChanged(sender As Object, e As EventArgs) Handles txtQty.TextChanged
If txtQty.Text > 1 Then
btnEnter.Show()
Else
btnEnter.Hide()
End If
End Sub
Private Sub txtAmount_onChanged(sender As Object, e As EventArgs) Handles txtAmount.TextChanged
If txtAmount.Text > txtTotal.Text Then
btnenter1.Show()
Else
MsgBox("Insufficient Amount!")
btnenter1.Hide()
End If
End Sub
Private Sub btnenter1_Click(sender As Object, e As EventArgs) Handles btnenter1.Click
txtChange.Text = Val(txtAmount.Text) - Val(txtTotal.Text)
btnenter1.Visible = False
End Sub
End Class