Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 Listbox to Array

$
0
0
I am having trouble converting a list box to an array. I cant seem to figure it out. Any help would be greatly appreciated.

Code:

Dim arr As String()
For i As Integer = 0 To selectedListBox.Items.Count - 1
    arr(i) = selectedListBox.Items(i).ToString()
    MsgBox(arr(i))
Next

Error:
Object not set to an instance of the object

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>