Ok so what i'm trying to do is grab some strings from a list box and put them in an array so i can list them in a message box each index of the array on a new line

so it comes up like this


you ordered :
arrayindex1
arrayindex2
arrayindex3 and so on

or is there a better way to go about this. please help <3

you can use for looping for example

for i as integer =0 to 5
listbox1.items.add(array(i))
next

If you just need the items from a ListBox added as a new line in a MsgBox, see if this helps.

Dim sTemp As String = Nothing '// store items and new lines.
        For Each itm As String In ListBox1.Items '// loop thru items.
            '// add to String as needed.
            If Not sTemp = Nothing Then sTemp &= vbNewLine & itm Else sTemp = "you ordered :" & vbNewLine & itm
        Next
        MsgBox(sTemp) '// display result.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.