473,395 Members | 1,762 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,395 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 5528
* "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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.