Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How can you add text and a number to a list box in vb.net?

I need to add the phrase "save" dblTotalB(which is $20.00) "with package B" to a list box. This is what I tried and it doesn't work.

If rdPackA.Checked = True Then

decSavingsB = (14.95 + ((dblHours - 20))) * (1 - dblDiscountRate)

decTotalB = (decSavingsB - dblTotal) * -1

lstDisplay.Items.Add(("Save" + decTotalB + "with package B").ToString("$#.00"))

End If

Please help!

3 Answers

Relevance
  • ?
    Lv 6
    7 years ago
    Favorite Answer

    try this

    '''''''''''' '''''''''''' '''''''''''' '''''''''''' '''''''''''' '''''''''''' ''''''''''''

    If rdPackA.Checked = True Then

    decSavingsB = (14.95 + ((dblHours - 20))) * (1 - dblDiscountRate)

    decTotalB = (decSavingsB - dblTotal) * -1

    lstDisplay.Items.Add(String.Format("Save {0:C2} with package B", decTotalB))

    End If

    '''''''''''' '''''''''''' '''''''''''' '''''''''''' '''''''''''' '''''''''''' ''''''''''''

  • 7 years ago

    This site might be able to help you. I have posted several questions in the past and all were resolved--

    http://www.dreamincode.net/forums/topic/245158-how...

  • 7 years ago

    In VBA, the cocatenation symbol is &, not +

Still have questions? Get your answers by asking now.