> Hi,
>
[quoted text clipped - 5 lines]
>
> Or is there a better way in VB.NET (Framework 1.1)
Maybe ListBox.Items.CopyTo would work for what you need? Do you know
what each item in the ListBox actually is? Strings? Ints? DataRows?

Signature
Patrick Steele
http://weblogs.asp.net/psteele
Philip - 26 Feb 2007 13:36 GMT
Hi, thanks,
all the items in the listbox are string values.
Philip
> > Hi,
> >
[quoted text clipped - 8 lines]
> Maybe ListBox.Items.CopyTo would work for what you need? Do you know
> what each item in the ListBox actually is? Strings? Ints? DataRows?
Patrick Steele - 26 Feb 2007 13:51 GMT
> Hi, thanks,
>
> all the items in the listbox are string values.
Then you should be able to create a string array equal to the number of
items in your listbox and use the CopyTo method to copy the items into
the string array.

Signature
Patrick Steele
http://weblogs.asp.net/psteele
Patrick Steele - 26 Feb 2007 13:58 GMT
> > Hi, thanks,
> >
[quoted text clipped - 3 lines]
> items in your listbox and use the CopyTo method to copy the items into
> the string array.
Sorry -- clarification:
You can copy the items into a string array and then create an arraylist
from the string array. Something like this:
Dim s(ListBox1.Items.Count) As String
Dim al As New ArrayList
ListBox1.Items.CopyTo(s, 0)
al = New ArrayList(s)

Signature
Patrick Steele
http://weblogs.asp.net/psteele
Philip - 26 Feb 2007 13:42 GMT
Hi,
I tried to do it using 'CopyTo' but I got this compile error:
'System.Collections.ArrayList' cannot be converted to '1-dimensional array
of System.Object'.
Here is the code I tried:
lstSelectedList.Items.CopyTo(m_arrSelList, 0)
thanks for any help
Philip
> > Hi,
> >
[quoted text clipped - 8 lines]
> Maybe ListBox.Items.CopyTo would work for what you need? Do you know
> what each item in the ListBox actually is? Strings? Ints? DataRows?