I am having trouble converting a list box to an array. I cant seem to figure it out. Any help would be greatly appreciated.
Error:
Object not set to an instance of the object
Code:
Dim arr As String()
For i As Integer = 0 To selectedListBox.Items.Count - 1
arr(i) = selectedListBox.Items(i).ToString()
MsgBox(arr(i))
NextObject not set to an instance of the object