472,952 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

listview index

who can I get the value of a selected "field" of a listview?

what I need to know is which index is selected and for exemple

LVtasks.items(SELECTEDiNDEX).text

is that?

tks
Nov 20 '05 #1
4 5515
* "Daniel Sélen Secches" <danielATcwdDOTcomDOTbr> scripsit:
who can I get the value of a selected "field" of a listview?

what I need to know is which index is selected and for exemple

LVtasks.items(SELECTEDiNDEX).text


See listview's 'SelectedIndices'/'SelectedItems' property.

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!
Nov 20 '05 #2
ok... i saw it but i didn't figure out how to use it...

can you give me a simple exemple?
like a listview1 and a lable1.

when the listview1_SelectedIndexChanged show the selected index on the
label1.text

tks...
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> escreveu na mensagem
news:%2****************@TK2MSFTNGP10.phx.gbl...
* "Daniel Sélen Secches" <danielATcwdDOTcomDOTbr> scripsit:
who can I get the value of a selected "field" of a listview?

what I need to know is which index is selected and for exemple

LVtasks.items(SELECTEDiNDEX).text


See listview's 'SelectedIndices'/'SelectedItems' property.

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!

Nov 20 '05 #3
"Daniel Sélen Secches" <danielATcwdDOTcomDOTbr> wrote in message news:<u6**************@TK2MSFTNGP11.phx.gbl>...
ok... i saw it but i didn't figure out how to use it...


Daniel,

I also found this confusing. Use either:

objListViewItem = ListView1.SelectedItems.Item(0)
'or whichever item you want

or

ID = SelectedID() 'where ID is integer

If you go to the project properties under 'Common Properties/Build'
and set Option Strict and Option Explicit on it will help you learn
the intricacies of VB.NET correctly to begin with.

Best of Luck,
Charlie
Nov 20 '05 #4
tks.... it helps me a lot....
i did that....

MsgBox(listview1.SelectedItems.Item(0).Index)
and works!!!!!!!!!!!!!!!!!!

tks again...

see you.
"Charlie Smith" <cw*****@tstar.net> escreveu na mensagem
news:f2**************************@posting.google.c om...
"Daniel Sélen Secches" <danielATcwdDOTcomDOTbr> wrote in message

news:<u6**************@TK2MSFTNGP11.phx.gbl>...
ok... i saw it but i didn't figure out how to use it...


Daniel,

I also found this confusing. Use either:

objListViewItem = ListView1.SelectedItems.Item(0)
'or whichever item you want

or

ID = SelectedID() 'where ID is integer

If you go to the project properties under 'Common Properties/Build'
and set Option Strict and Option Explicit on it will help you learn
the intricacies of VB.NET correctly to begin with.

Best of Luck,
Charlie

Nov 20 '05 #5

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

Similar topics

8
by: Jon Ripley | last post by:
Using VB6 (for two weeks!) I could get a ListBox search working perfectly but with a ListView it has completely stumped me. I've not found any previous posts that have helped :( The user...
0
by: willow1480 | last post by:
I am developing a small little Service Control Application. I am using a listview control with checkboxes and getting the list of services I want to control from a text file. When you check a...
0
by: Samuel R. Neff | last post by:
I'm having a index problem with ListView SubItems. If I add multiple columns to the listview and then add items with associated subitems, the ListView displays fine. Then if I delete a column via...
4
by: Jan | last post by:
How do i get the index of a selected item from a listview, I know how it works for a listbox. But I can't figure it out for a listview? Another newbee question By the way, thx for the answers...
6
by: Nick | last post by:
Hi there, I'm trying to implement drag-drop for my listview control in large icon view mode. Unfortunately the order of the items gets completely messed up upon inserting the item back into the...
6
by: Jack | last post by:
Hello, I've noticed through searching this group's previous posts that one can get the item the mouse is over in a listview control but I did not see how to get the subitem the mouse is over. Is...
1
by: Chris | last post by:
Hi all, I posted the following in microsoft.public.dotnet.framework.windowsforms but it seems that group has little traffic. Hi all, I have a listview box which is populated from methods of...
4
by: Steph. | last post by:
I have a List view displaying data in Detail mode with several columns. How I can get the column index the user clicked on ? (when user click on an item inside the ListView, not on a column...
5
by: Phill W. | last post by:
(VB'2003) What's the correct way to remove multiple, selected items from a ListView control (say, from a ContextMenu)? I ask because I'm getting a very annoying ArgumentOutOfRangeException...
2
by: witpo | last post by:
Hi, I would like to display all listview items in one row with scroll bar below it – instead of multiple rows and scroll bar on the right. Someone told me that I can achieve it using...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.