0
中使用與「%%」相同的條件搜索列表框如何在sql 中使用與「%%」相同的條件搜索ListBox,例如如果列表包含以下項目{cat,dog,帶戒指的貓,帶骨的狗} 並在文本框中輸入「with」。我需要過濾這個列表框只記錄包含單詞「with」(即{cat with ring,dog with bone})。如何在sql
到目前爲止,我可以搜索並選擇使用此代碼與輸入字符串開始的項目..
private void txtSearch_TextChanged(object sender, EventArgs e)
{
int index = lst.FindString(this.txtSearch.Text);
if (0 <= index)
{
lst.SelectedIndex = index;
}
}
你的列表框是如何填充的?是否綁定到數據源?你有沒有考慮過使用'string.Contains'來過濾它? – 2013-02-12 21:59:25
http://stackoverflow.com/questions/12068154/on-the-fly-search-algorithm-in-listbox – MethodMan 2013-02-12 22:00:10