• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

ListBox Items collection to String Array in VB.NET 1.1

Hi

Here is a helper function I have that I use to return the elements of a list box as a string array.  Is there a better way ?

Orekin

        Public Shared Function ReturnListBoxItemsAtStringArray(ByVal theListBox As Windows.Forms.ListBox) As String()
            Dim strArr As String()
            ReDim strArr(theListBox.Items.Count - 1)
            theListBox.Items.CopyTo(strArr, 0)
            ReturnListBoxItemsAtStringArray = strArr
        End Function
0
orekin
Asked:
orekin
1 Solution
 
Bob LearnedCommented:
No, that's pretty good already.

Bob
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now