954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

I need Help with arrays [VB.net]

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

iBlake
Newbie Poster
1 post since Apr 2011
Reputation Points: 10
Solved Threads: 0
 

you can use for looping for example

for i as integer =0 to 5
listbox1.items.add(array(i))
next
Sultan ALfarsi
Newbie Poster
3 posts since Apr 2011
Reputation Points: 10
Solved Threads: 0
 

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.
codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: