I need to get an increase amount from an input box to increase the price by the amount put in the input box. I cannot figure out how to convert the entry in the input box to a decimal that should display in a listbox. Any help would really be appreciated.
This is my code:
CODE
Private Sub increaseButton_Click(ByVal sender As Object, ByVal _
e As System.EventArgs) Handles increaseButton.Click
Dim prices() As Decimal = {3.75D, 11.5D, 31.5D, 10D, 9.5D, _
25.5D, 5.64D, 8.35D, 10.75D, 3.5D}
Dim increase As Decimal
Dim isConverted As Boolean
Dim getIncreaseAmount As String
Dim Prompt As String = "Enter increase"
Dim Title As String = "Increase"
getIncreaseAmount = InputBox("Enter price increase")
isConverted = Decimal.TryParse(getIncreaseAmount)
increase = getIncreaseAmount
If isConverted Then
For Each price As Decimal In prices
price = price + increase
newListBox.Items.Add( _
price.ToString("N2").PadLeft(6) _
& ControlChars.NewLine)
Next price
End If
End Sub
End Class