473,382 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Which listview items are selected?

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
|
Nov 21 '05 #1
3 1408
"Julian Milano" <jd****@datafast.net.au> schrieb:
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
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
i think it is ListView1.SelectedItems, here you have all the items that youve
selected.

"Herfried K. Wagner [MVP]" wrote:
"Julian Milano" <jd****@datafast.net.au> schrieb:
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
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
"Rothariger" <Ro********@msn.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: AndyDunning | last post by:
Folks, I'm loading a listview on a form with Vehicle Data for a specified client. I also pass in a specific registration relating to a current client request. The record is displayed and the...
4
by: Paddy | last post by:
How do I select a subitem from a listview after clicking on the first column? Couldn't find it in MSDN. Thank you. Paddy.
2
by: Alberto | last post by:
I need a listview where the user can select the items with the arrow keys but I also want that it works in a circular way: if you are in the first item and press key up, the last item is selected...
7
by: GTi | last post by:
I have a listview that with selected items. But I want to "reselect" items after a refresh. Each items have a uniqe value in the Tag object. After a refresh some new items may be added or removed...
1
by: Shane | last post by:
I have a text box select items in a listview as text is being typed into the text box. I get the select bar to move correctly in the Listview control. If the user presses the down or up key in...
4
by: Shane | last post by:
I have a text box select items in a listview as text is being typed into the text box. I get the select bar to move correctly in the Listview control. If the user presses the down or up key in...
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
2
by: Mike | last post by:
Ok I'm having a problem with a listview. I have a listview on a WinForm called ProgramInformationFrm. I call this from from 2 other forms. One is ProgramSearch Frm, the other is OpenNCFrm. The...
4
by: Bill-R | last post by:
I'm trying to convert a vb6 program to vb.net (vb2008 express) I have text data in a Listview Control I use a Textbox to enter characters to search the Listview When a Match is found, I use...
0
by: lsharva | last post by:
Actually, i m working on Windows Application where i have to use the ComboBox and listview in a way , as first we will click the comboBox and then as you click , ListView appear and when we...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.