listview index

  • Thread starter Thread starter Daniel Sélen Secches
  • Start date Start date
D

Daniel Sélen Secches

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
 
* "Daniel Sélen Secches said:
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.
 
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...
 
Daniel Sélen Secches said:
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
 
tks.... it helps me a lot....
i did that....

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

tks again...

see you.
 
Back
Top