tags:

views:

172

answers:

1

Hello, Using 3.5 VB1 framework.net

I'm trying to add an element to an array

i would like to clear the listbox and display the array contents in listbox.

then add another button, then add an element to the array, from the textbox.

Ive created this painstakingly for the past 6 hours

Call clearout()    ''===== Clears listbox
Dim MyNumbers(4) As Integer

Dim i As Integer

MyNumbers(0) = 1
MyNumbers(1) = 2
MyNumbers(2) = 3
MyNumbers(3) = 4
MyNumbers(4) = 5
For i = 0 To 4
    ListBox1.Items.Add(MyNumbers(i))
Next i

That part works great!

It plops it right into listbox and deletes any previous entries into listbox What Ive studied so far after all these hours to make the next button is to use UBound function to find the highest element then add one to it and ReDim it with that value

Problem is I'm not sure how to write that correctly under the second button

Any help?

A: 
CMH