我使用文本框搜索listview表,onText_changed我有:
Private Sub txtBoxSearchSearches_TextChanged(sender As Object, e As EventArgs) Handles txtBoxSearchSearches.TextChanged
listViewShowLinks.BeginUpdate()
If (txtBoxSearchSearches.Text.Trim().Length = 0) Then
listViewShowLinks.Items.Clear()
For Each item In listCopy
listViewShowLinks.Items.Add(item)
Next
Else
listViewShowLinks.Items.Clear()
For Each item In listCopy
If (item.Text.Contains(txtBoxSearchSearches.Text)) Then
listViewShowLinks.Items.Add(item)
End If
Next
End If
listViewShowLinks.EndUpdate()
End Sub
哪个有效,问题是,它只搜索列表视图中第一列输入的数据,但我希望使用#8列,我不确定最好的方法去吧。
任何帮助将不胜感激:)
欢呼声
格雷厄姆
答案 0 :(得分:0)
您可以使用以下内容专门引用这些项目:
for i = 0 to listview1.coulmns(7).Items.Count - 1
'Do whatever you need with the below.
ListView1.Columns(7).Items(i).text
Next