how to write an array into list box?

Array of what? If it's Strings then either of these will work:
VB.NET:
myListBox.Items.AddRange(myArray)
myListBox.DataSource = myArray
The second option will not allow you to add or remove items without changing the DataSource, while the first will allow you to edit the Items collection as you like.
 
jmcilhinney said:
Array of what? If it's Strings then either of these will work:
VB.NET:
myListBox.Items.AddRange(myArray)
myListBox.DataSource = myArray
The second option will not allow you to add or remove items without changing the DataSource, while the first will allow you to edit the Items collection as you like.

thanks~
but i want to use the array value from the first form- to be populated to the second form?
how can i do that?
 
An array is an array, regardless of where it comes from. It would seem that what you're really asking is how do you pass values from one form to another. Forms are objects just like any other in .NET. To get data into an object you either set a property or pass a parameter to a method, which includes the constructor. I strongly suggest that you read the first link in my signature. Make sure you read all three parts.
 
Back
Top