Listview.. get clicked item.

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

I downloaded all of the Newsgroup and did a find.. didn't see answer..
How do you find which item is clicked on, with a Listview.

..SelectedIndexCollection or .SelectedIndices looked like a light at the
end of the tunnel but I cant seem to get
this puppy to work for me.

help please I wasted a lot of time on this.. to the point where I will write
my own user-drawn to get past this.
hmph!

-Pat (Ashmed to put name to this as I know the solution is !SO! simple)
Thanks
 
mListView.Items(mListView.SelectedIndices(0))

but check the Selectedindices count>0 first

Cheers
Daniel
 
Great! it worked.. thanks Daniel..

To complete this thread here is the code..

Private Sub LSV_ItemActivate(ByVal sender As Object, ByVal e As
System.EventArgs) Handles LSV.ItemActivate

If LSV.SelectedIndices.Count > 0 Then

Dim LI As ListViewItem = LSV.Items(LSV.SelectedIndices(0))
MsgBox(LI.Text)

End If

End Sub
 
Back
Top