This is some of my code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'clears everything
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox3.Text = TextBox1.Text * TextBox2.Text 'subtotal
If TextBox4.Text > 0 Then 'if the check box is checked adds electricity
TextBox5.Text = TextBox3.Text + TextBox4.Text
Else : TextBox5.Text = TextBox3.Text 'if not checked it skips electricity
End If
End Sub
This is the error
Conversion from string "" to type 'Double' is not valid
TextBox3.Text = TextBox1.Text * TextBox2.Text 'subtotal
What do I need to change?
Also what is a quick and easy way to display a textbox as currency like this: XX,XXX.XX
Last question how do I write the code to clear the checkbox for a reset button? I tried the ""
2007-10-13
12:21:19
·
4 answers
·
asked by
Josh
1
in
Computers & Internet
➔ Programming & Design