I have a listview which is populated with values from a data base. What i am trying to do is select an item from the listview via a checkbox and then have that value displayed in a listbox. But everytime all that is displayed in the list box is:


The code i am using to populate the listbox is:


I wondered if anyone had any ideas?


so, your checkbox on listview is true...

yes, the checkbox is true and this is how the selection is made on the listview.

I have started to get the result i want, but its not perfect.

the new code im using is:

For Each Item As Object In ListView1.CheckedItems


Now what i get written to the listbox is:

ListViewItem: {12}

With 12 being the value of the first column in the listbox, but all i want to e returned is the 12, and not all the other bits.

I wondered if anyone knew where i was going wrong?

Just a little wrong :

For Each Item As Object In ListView1.CheckedItems


fixed it with this -

For Each itemlist As ListViewItem In ListView1.CheckedItems


had to change it from 'object' to 'ListViewItem'

i then had the text option

many thanks for your help

you're welcome...
don't forget to mark this thread solved
Happy coding :)