How can I copy an array to a listbox?
Printable View
How can I copy an array to a listbox?
Use an arraylist instead and you can bind directly to the listbox's datasource.
Dim arText() As String = {"", "Red", "White", "Blue"}
ListBox1.DataSource = arText
Cool you can bind to an array too, anything that implements IList or IListSource. Then if you don't want to bind to it you can add it like this:
VB Code:
Dim arText() As String = {"", "Red", "White", "Blue"} ListBox1.Items.AddRange(arText)