在组合框中搜索项目 [英] search item in combo box
本文介绍了在组合框中搜索项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何通过命令...在其中的项中搜索项目... where item like =``%% string''condition
how can i search items in a combo box by the command ...where item like= ''%%string'' condition
推荐答案
请尝试以下操作:
其中的项目如" + comboBoxName.selectedItem.ToString()+%"
try this:
where item like ''" + comboBoxName.selectedItem.ToString() + "%''
尝试LINQ ..
try LINQ..
using System.Linq;
IEnumerable<Object> query =
from Object item in comboBox1.Items
where (item.ToString().ToUpper().Equals(textBox1.Text))
select item;
foreach (Object obj in query)
{
comboBox1.SelectedItem = obj;
MessageBox.Show("Found");
}
这篇关于在组合框中搜索项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文