Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

how to write an array into list box?

anyone know the coding to write an array into list box?
[55 byte] By [izza_azhar] at [2007-11-11 8:18:06]
# 1 Re: how to write an array into list box?
lstBox.Items.AddRange(myArray)
Phil Weber at 2007-11-11 21:47:48 >
# 2 Re: how to write an array into list box?
lstBox.Items.AddRange(myArray)

thanks~
but how to use the the array value from the first form- to be populated in the second form?
do u have any idea?
izza_azhar at 2007-11-11 21:48:41 >
# 3 Re: how to write an array into list box?
I would add a public method to the form containing the listbox:

Public Sub PopulateListbox(ByVal items() As Object)
lstBox.Items.AddRange(items)
End Sub

and call it from the first form:

frmTwo.PopulateListbox(myArray)
Phil Weber at 2007-11-11 21:49:50 >