Question
I am creating a cash register app. When the total button is hit, the subtotal, tax, and total is displayed in textboxes. I have this
I am creating a cash register app. When the total button is hit, the subtotal, tax, and total is displayed in textboxes. I have this code for the total box. When I run it, I get an I get an InvalidCastException. Says that the conversion from string 'textbox' to type 'double' is not valid? Can anyone help? VISUAL BASIC PLEASE VISUAL BASIC PLEASEVISUAL BASIC PLEASE VISUAL BASIC PLEASEVISUAL BASIC PLEASE VISUAL BASIC PLEASEVISUAL BASIC PLEASE VISUAL BASIC PLEASEVISUAL BASIC PLEASE VISUAL BASIC PLEASE Private Sub TextBox_tax_TextChanged(sender As Object, e As EventArgs) Handles taxBox.TextChanged If taxBox.Text.Length <> 0 Then Dim subtot As Double = subtotalBox.Text Dim tax As Double = taxBox.Text Dim taxamt As Double taxamt = (subtot * tax) / 100 Dim tot As Double tot = subtot + taxamt totalBox.Text = tot Else totalBox.Text = "" End If End Sub VISUAL BASIC PLEASE VISUAL BASIC PLEASEVISUAL BASIC PLEASE VISUAL BASIC PLEASEVISUAL BASIC PLEASE VISUAL BASIC PLEASEVISUAL BASIC PLEASE VISUAL BASIC PLEASE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started