There is a problem with my app "Garage sale calculator" where i type something in to the tax and cost Textboxes and then when i click add item it displays the $ symbol since i used ToString("$") but it does not display the values inputted by the user for tax and profits, PLEASE HELP!!
Here is my code
Private Sub btnadditem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadditem.Click
If IsNumeric(txtboxtax.Text) And IsNumeric(txtboxitemcost.Text) Then
ltboxitems.Items.Add(txtboxitemname.Text & " - " & txtboxitemcost.Text & "$")
Dim dbltotalprofit As Double
Dim dbltemp As Double
Dim dblstore As Double
Dim strtotalprofit As String
Dim strtotaltax As String
dbltemp = CDbl(txtboxtax.Text) / 100
dblstore += dbltemp
dbltotalprofit += CDbl(txtboxitemcost.Text) * dbltemp
strtotaltax = dblstore.ToString("$")
strtotalprofit = dbltotalprofit.ToString("$")
lbltotaltax.Text = "Tax:" & strtotaltax
lbltotalprofits.Text = "Total profits:" & strtotalprofit
Else
MessageBox.Show("Please enter a numeric value in item cost and tax textboxes.")
End If
End Sub
and here are some screen shots
Attachment 99583
neutral
Attachment 99585
Values entered
Attachment 99587
After Add item is clicked
Again please help if you can and thank you for your consideration.
Here is my code
Private Sub btnadditem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadditem.Click
If IsNumeric(txtboxtax.Text) And IsNumeric(txtboxitemcost.Text) Then
ltboxitems.Items.Add(txtboxitemname.Text & " - " & txtboxitemcost.Text & "$")
Dim dbltotalprofit As Double
Dim dbltemp As Double
Dim dblstore As Double
Dim strtotalprofit As String
Dim strtotaltax As String
dbltemp = CDbl(txtboxtax.Text) / 100
dblstore += dbltemp
dbltotalprofit += CDbl(txtboxitemcost.Text) * dbltemp
strtotaltax = dblstore.ToString("$")
strtotalprofit = dbltotalprofit.ToString("$")
lbltotaltax.Text = "Tax:" & strtotaltax
lbltotalprofits.Text = "Total profits:" & strtotalprofit
Else
MessageBox.Show("Please enter a numeric value in item cost and tax textboxes.")
End If
End Sub
and here are some screen shots
Attachment 99583
neutral
Attachment 99585
Values entered
Attachment 99587
After Add item is clicked
Again please help if you can and thank you for your consideration.