Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 检索listview virtualmode中的某些项_Vb.net - Fatal编程技术网

Vb.net 检索listview virtualmode中的某些项

Vb.net 检索listview virtualmode中的某些项,vb.net,Vb.net,我正在使用启用了VirtualMode的ListView 使用此子项从列表中检索项目(属于listviewitem) Dim客户作为新的LIT(属于ListViewItem) 作为新LIT搜索的Dim客户(属于ListViewItem) 私有子CustomerList\u RetrieveVirtualItem(发送方作为对象,e作为RetrieveVirtualItemEventArgs)处理CustomerList.RetrieveVirtualItem 如果是searchbox.text“

我正在使用启用了
VirtualMode
ListView

使用此子项从列表中检索项目(属于listviewitem)

Dim客户作为新的LIT(属于ListViewItem)
作为新LIT搜索的Dim客户(属于ListViewItem)
私有子CustomerList\u RetrieveVirtualItem(发送方作为对象,e作为RetrieveVirtualItemEventArgs)处理CustomerList.RetrieveVirtualItem
如果是searchbox.text“”,则
e、 Item=搜索的客户(例如ItemIndex)
其他的
e、 项目=客户(如项目索引)
如果结束
端接头
一切正常

我想要的:我不想搜索其他
客户
列表,因为我需要很多时间更新
客户
列表中的一些项目,我不想在
客户
列表中更新两次


我希望
CustomersList\u RetrieveVirtualItem
仅检索匹配到
seachedbox.text
的项目,并且仍然拥有
客户的完整列表
我发现,如果我更新第一个列表中的项目,它会在另一个列表中更新,因为该项目本身仍然存在

我不知道为什么有些用户会否决这篇文章 无论如何谢谢你

Dim Customers AS New Lits(of ListViewItem)
Dim Customers_Searched AS New Lits(of ListViewItem)  

Private Sub CustomersList_RetrieveVirtualItem(sender As Object, e As RetrieveVirtualItemEventArgs) Handles CustomersList.RetrieveVirtualItem

     If searchbox.text <> "" Then 
         e.Item = Customers_Searched(e.ItemIndex)
     Else
         e.Item = Customers(e.ItemIndex)
     End If

End Sub