@ggeu
Who is talking about vb6? OP didn't mention anything about that and also he posted in the .NET-forum...
@Aussie1333: When you declare something, you want to give it a type. Generally, it looks like this:
I guess you have in mind that you want to display a list of pizza's in a listbox. For that, you want to create an array of 8 items. Of course, these are all hypothetical assumptions. Say you want to save 8 different names of pizza's. A name is a string, so you create a string array.
- Dim strPizzaArray(7) as String
Check out the
MSDN on Arrays to learn more. Now, you have an array of 8 empty strings (0...7) you want to fill. You can do that like this:
- strPizzaArray(0) = "Pepperoni"
-
strPizzaArray(1) = "Funghi"
-
strPizzaArray(2) = "Quattro Formaggio"
-
etc...
Now, I'm assuming you have a
Listbox on a form called Listbox1. You can loop through the array with pizza names to add them to the lisbox. It should look a bit like this:
- For a As Integer = 0 to strPizzaArray().Length - 1
-
Listbox1.Items.Add(strPizzaArray(a))
-
Next
I think this should answer some of your questions. Have fun!
Steven