【发布时间】:2014-05-01 15:43:45
【问题描述】:
我有一个字典应用程序,并且我的应用程序连接了单词的数据库,现在我想创建一个简单的搜索框(使用文本框和按钮)在我的列表框中搜索单词。
我在按钮代码中发现这对我很有用,但其余的呢?
private void searchBTN_Click_1(object sender, RoutedEventArgs e)
{
foreach (Wordst item in mainlist.Items)
{
if (item.listwordsw == txtSearch.Text)
{
//What should I have Here?
}
foreach (Wordst subItem in mainlist.Items)
{
if (subItem.Listwords2== txtSearch.Text)
{
//What should I have Here?
}
}
}
}
【问题讨论】:
-
您能否举例说明列表和搜索框将包含的内容以及您希望结果的外观。
标签: c# wpf windows-phone-8 textbox listbox