如何标记检测列表框vb.net中的某些单词 [英] how to label detect some of the words in listbox vb.net

查看:81
本文介绍了如何标记检测列表框vb.net中的某些单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在form1中,对象,label1,listbox2,listbox3,listbox1

listbox1和listbox2和listbox3,它具有项目

"flash 354""windows 1"

listbox2
"flash 456""--22-- Windows 1"

listbox3
"flash 65""play-- Windows 1"

我想当我单击listbox1或2或3然后选择label1时,使用
检测带有单词的项目 "Windows"



然后label1.text = listbox1.text
其他
label1.visible = false

in form1 , objects , label1, listbox2 ,listbox3 , listbox1

listbox1 and listbox2 and listbox3 , it has items

"flash 354 " "windows 1"

listbox2
"flash 456 " "--22-- windows 1"

listbox3
"flash 65 " "play-- windows 1"

i want to when i click listbox1 or 2 or 3 then label1 , detect items that have word with
" windows "

and

then label1.text = listbox1.text
else
label1.visible =false

推荐答案

像这样吗?

Something like this?

If listbox1.SelectedItem.ToString.Contains(" windows ") Then
   label1.Text = listbox1.Text
Else
   label1.Text = String.Empty
End If


这篇关于如何标记检测列表框vb.net中的某些单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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