ListBox Question

adwaitjoshi

Active member
Joined
Dec 29, 2005
Messages
38
Programming Experience
1-3
I have to listboxes The use select items from first list box and then clicks on one button and they are removed from the first listbox and added to the second one. I was trying the following code

Dim item As control
For Each item In ListBox1.SelectedItems
'If item.Selec Then Then
ListBox2.Items.Add(item)
ListBox1.Items.Remove(item)

Next

It gives me invalid cast error at For Each item In ListBox1.SelectedItems

I dont have a item object where I can say
Dim item As ListBoxItem

can someone please help me with this?
 
Back
Top