2011-01-31 91 views
2

我已在我的列表视图如何获得

  • MULTISELECT =假
  • 查看这些选项的选择列表视图项的索引号=细节
  • FullRow选择=真
  • HideSelected =假。

我有一列有10个项目。我想选择的行索引中vb.net

回答

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

在VB.NET记住的indeces从0开始。

4

试试这个:

Dim x as Integer 
x = ListView1.FocusedItem.Index 

为了获取值:

Dim txtValue as String 
txtValue = ListView1.FocusedItem.SubItems(0).text