Which listview items are selected?

  • Thread starter Thread starter Julian Milano
  • Start date Start date
J

Julian Milano

I'm using the following code to act on only the selected items in a
listview. The items are selected via checkboxes:

Dim indexes As ListView.SelectedIndexCollection = .SelectedIndices
For Each i In indexes
ActiveXFileName = .Items(i).ToString
Call RegisterActiveXFile(ActiveXFileName)
Next
For some reason it does not work. Can someone explain why?
 
Julian Milano said:
I'm using the following code to act on only the selected items in a
listview. The items are selected via checkboxes:

Dim indexes As ListView.SelectedIndexCollection = .SelectedIndices
For Each i In indexes
ActiveXFileName = .Items(i).ToString
Call RegisterActiveXFile(ActiveXFileName)
Next
For some reason it does not work. Can someone explain why?

\\\
For Each Item As ListViewItem In Me.ListView1.CheckedItems
Call RegisterActiveXFile(Item.Text)
Next Item
///
 
Rothariger said:
i think it is ListView1.SelectedItems, here you have all the items that
youve
selected.

I was irritated by the "the items are selected via checkboxes" in the OP's
post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top