Link to home
Start Free TrialLog in
Avatar of KenTan85
KenTan85

asked on

How to get the value or index of a selected ListView???

I am working in Visual Studio 2005 PocketPc VB.NET, currently I had a ListView control, how do I get the user selected item value or index???
Avatar of garethh86
garethh86
Flag of United Kingdom of Great Britain and Northern Ireland image

Code below, assign it to a button click or repost when the user selects an item.

Hope this helps!
Dim UserSelectedItem = ListView1.SelectedItems
Label1.Text = UserSelectedItem

Open in new window

Avatar of KenTan85
KenTan85

ASKER

There is no .SelectedItems in PocketPC Version.
Sorry, seems your correct there, never really played around with PPC dev, you would imagine it was the same code wise. Try this:

listview.selectedindices

http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.selectedindices(VS.80).aspx

Hope this helps!
Do not quite understand the way the he used selectindices, could you kindly explain a little n if possible with a little code sample, that would be well.
listview.selectedindices is getting the index of the item or wat???
ASKER CERTIFIED SOLUTION
Avatar of garethh86
garethh86
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial