文本框中输入内容,listbox快速查询定位。
解决方案 »
- python rs232 中的readexsiting
- 在线等,急用,顶的都有分,数据库连接问题
- c# 调用delphi的问题
- 为什么关闭入口窗体就全部关闭了??
- “BLL.School.PraxisInfro”不可访问,因为它受保护级别限制 (怎么回事呀)
- 读取oracle的nclob类型!
- 相对路径问题
- 安装程序问题,如何在安装完后加个复选框自动运行刚刚装的程序?100分相送!
- textbox(winform)数据绑定后更新的问题
- 再过几年程序员就和装机的一样成为没有水平的了!
- 数据库查询有无某个数据库,提示对象名 'sys.databases' 无效。
- ConnectionString 属性尚未初始化,哪位高手知道是什么原因呀?
char c = s.Length > 0 ? '\0' : s[0];foreach(Control item in listBox1.Items){
string f = item.Text;
if(f[0] == c && f.StartWith(s)) {
Select(item);
break;
}
}
private void FindMySpecificString(string searchString)
{
// Ensure we have a proper string to search for.
if (searchString != string.Empty)
{
// Find the item in the list and store the index to the item.
int index = listBox1.FindStringExact(searchString);
// Determine if a valid index is returned. Select the item if it is valid.
if (index != ListBox.NoMatches)
listBox1.SetSelected(index,true);
else
MessageBox.Show("The search string did not find any items in the ListBox that exactly match the specified search string");
}
}