如何删除不在VB.NET中的另一个列表框中退出的列表框项目 [英] How to remove listbox items which are not exits in another listbox in VB.NET

查看:108
本文介绍了如何删除不在VB.NET中的另一个列表框中退出的列表框项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何删除另一个列表框中不存在的列表框项目?

我在这里举了一个例子....

ListBox1项目是....

一个
两个
三人
四人

ListBox2项是....

一个
两个
三人
四人

六个

请注意,ListBox2中的项目五个"和六个"在ListBox1中不存在.因此,这两个应删除.

因此,请在这方面指导我.
Ashu

How we can remove the listbox items which are not exists in another listbos?

I have given an example here....

ListBox1 items are....

One
Two
Three
Four

ListBox2 items are....

One
Two
Three
Four
Five
Six

Please note that, items "Five" and "Six" in ListBox2 are not exists in ListBox1. So, these two should be deleted.

So, please guide me in this regard.
Ashu

推荐答案

for each item in ListBox2
  if not item exists in ListBox1
  then
    delete item
  endif
endfor


ListBox文档 [


The ListBox documentation[^] will help you figure out the rest.


这篇关于如何删除不在VB.NET中的另一个列表框中退出的列表框项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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