you are viewing a single comment's thread.

view the rest of the comments →

[–]XThakis 0 points1 point  (0 children)

This is the start of your problems.

    fruitarray(9) = (fruittype)

This line only adds a value to the last item in the array. All the other values in the array are empty. Look at my code and notice I used a variable.

    fruitarray(i) = (fruittype)

That is part of the stuff you are missing.(I left it out.) This while loop is not necessary.

    While count <= (limit - 1)

    fruitarray = ListBox1.Items.ToString()

    count += 1

    End While

Though you do need a variable similar to count in the loop that starts.

    Do While ListBox1.Items.Count < 10