468,491 Members | 2,048 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,491 developers. It's quick & easy.

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 5426
* "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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Jon Ripley | last post: by
reply views Thread by willow1480 | last post: by
4 posts views Thread by Jan | last post: by
6 posts views Thread by Nick | last post: by
6 posts views Thread by Jack | last post: by
1 post views Thread by Chris | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.