Search code examples
vb.netwinformslistviewlistviewitem

How to get the index number of the selected listview item


I have set these options on my listview

  • multiSelect = false
  • view = details
  • FullRow select = true
  • HideSelected = False.

I have one column which has 10 items. I want to get the selected row index in vb.net


Solution

  • Dim index As Integer = ListView1.SelectedIndices(0)
    

    remember indeces in VB.NET are 0-based.