Vb.net 如何搜索一个列表框并将所有结果保存在另一个列表框中?

Vb.net 如何搜索一个列表框并将所有结果保存在另一个列表框中?,vb.net,Vb.net,现在,我正在使用这个代码,但它没有给我想要的。。 例如,我想用字符串1列出所有项目 Dim x, count As Integer x = ListBox1.Items.Count count = 0 Do While count < x If ListBox1.SelectedIndex = ListBox1.FindString("1") Then ListBox2.Items.Add(ListBox1.Items(count)) End If

现在,我正在使用这个代码,但它没有给我想要的。。 例如,我想用字符串1列出所有项目

Dim x, count As Integer
x = ListBox1.Items.Count
count = 0


Do While count < x
    If ListBox1.SelectedIndex = ListBox1.FindString("1") Then

        ListBox2.Items.Add(ListBox1.Items(count))

    End If
    count = count + 1
Loop
试试这个

foreach (string s in listBox1.Items)
      {
        if(s.contains("1"))
        listbox2.add(s);
      }

地铁WinForms?WPF?银灯?ASP.Net?MonoTouch?VB.net,很抱歉未完成帖子..什么用户界面?地铁WinForms?WPF?银灯?ASP.Net?单触式?