我想显示第3列而不是第1列的值。 Pleae建议改变是必要的。
Dim blnFoundFirstItem As Boolean
blnFoundFirstItem = False
Dim i As Integer
For i = 1 To ListView16.ListItems.Count
If (ListView16.ListItems(i).Selected) Then
If (Not blnFoundFirstItem) Then
TextBox118.Text = ListView16.ListItems(i).Text
blnFoundFirstItem = True
Else
TextBox118.Text = ListView16.ListItems(i).Text
End If
End If
Next i
答案 0 :(得分:0)
使用ListSubItems()
:
Dim blnFoundFirstItem As Boolean
blnFoundFirstItem = False
Dim i As Integer
For i = 1 To ListView16.ListItems.Count
If (ListView16.ListItems(i).Selected) Then
If (Not blnFoundFirstItem) Then
TextBox118.Text = ListView16.ListItems(i).ListSubItems(3).Text
blnFoundFirstItem = True
Else
TextBox118.Text = ListView16.ListItems(i).ListSubItems(3).Text
End If
End If
Next i