转移到其他列表框时过滤列表框项目 [英] Filtering listbox items when transferring to another listboxes

查看:88
本文介绍了转移到其他列表框时过滤列表框项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i有两个列表框,我希望将listbox1项目转移到listbox2并进行一些过滤。



i查找将以123开头的列表框项目转移到另一个列表框的代码。



ex:listbox1 items = {564dfgg,123rtete,967asdasd} <设置以123开头过滤器后,






listbox2 items = {123rtete}







我也在几个小时前在MSN论坛上询问,但我没有得到很好的答案。



Regard



-Amir Mohammad Nasrollahi



i have two listbox which i want transfering listbox1 items to listbox2 with some filtering.

i look for a code which transfer items of listbox which start with "123" to another listbox.

ex: listbox1 items = { 564dfgg , 123rtete , 967asdasd}

after set "start with 123" filter:

listbox2 items = { 123rtete }



Also i ask in MSN Forums some hours ago but i receive no good answer.

Regard

-Amir Mohammad Nasrollahi

推荐答案

:S


完美运行,运行:



https://www.dropbox.com/s/u9uina9n755mpzo/WindowsApplication11.rar [ ^ ]


:-)



:-)

Dim filteredItems = From item In ListBox1.Items Select item Where item.ToString.StartsWith("123")
ListBox2.Items.AddRange(filteredItems.ToArray)


这篇关于转移到其他列表框时过滤列表框项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆