Friday, March 16, 2012

listbox help

I want to loop though a list box and select each item. I am testing it by looping though one listbox and then selecting each item in this list box then adding it to another list box here is my code

Dim Test
listCount = lstMoviesFinalize.Items.Count
For index = 1 To listCount Step 1
Test = lstMoviesFinalize.WHAT DO I PUT HERE(index)
lstTest.Items.Add(Test)
Next indexA better way is to do the following...

Dim ListItem As ListItem

For Each ListItem In lstMoviesFinalize.Items
lstTest.Items.Add(ListItem)
Next

that's it!

hope this helps,

sivilian

0 comments:

Post a Comment