I have to create a form that I enter the price of gas each month over a year. I enter the price in a text box and click the enter button to send the price to a list box immediatley and use an array. I have the following code but I don't think it's working with the array correctly as it will let me enter the information but doesn't stop letting me enter after the 12 prices. I am really having a hard time trying to figure out how to set up this input for an array and make it all work.
Dim priceArray(11) As Decimal Dim price As Decimal Private Sub enterButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles enterButton.Click If enterPriceTextBox.Text <> String.Empty Then gasPricesListBox.Items.Add(enterPriceTextBox.Text) enterPriceTextBox.Clear() End If End Sub