如何在Mdi子窗体中实现自动完成文本框 [英] How to implement Autocomplete textbox in Mdi child form
本文介绍了如何在Mdi子窗体中实现自动完成文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
任何人都可以让我知道自动完成Mdi儿童形式的工作原理吗?
我已经创建了简单的窗口,因为下面的代码工作正常,但相同的代码,如果我实现它到MDI子窗体然后相同的建议不起作用?
Hi All,
Can any one please let me know how the Auto complete works in Mdi child form ?
I have created the simple windows from in that the below code is working fine but the same code if i implement it to MDI Child form then the same suggestion is not working?
using (OleDbConnection con = new OleDbConnection(ConString))
{
OleDbCommand cmd = new OleDbCommand("Select ConsigneeName From tblConsignee", con);
OleDbDataReader dReader;
SqlConnection conn = new SqlConnection();
con.ConnectionString = ConString;
con.Open();
dReader = cmd.ExecuteReader();
if (dReader.HasRows == true)
{
while (dReader.Read())
namesCollection.Add(dReader["ConsigneeName"].ToString());
}
else
{
}
dReader.Close();
txtConsigneeName.AutoCompleteCustomSource = namesCollection;
txtConsigneeName.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
txtConsigneeName.AutoCompleteSource = AutoCompleteSource.CustomSource;
}
推荐答案
试试这样:
< a href =http://www.dotnetfunda.com/articles/show/225/creating-autocomplete-textbox-in-windows-froms-using-csharp> http://www.dotnetfunda.com/articles/show / 225 / creating-autocomplete-textbox-in-windows-froms-using-csharp [ ^ ]
这篇关于如何在Mdi子窗体中实现自动完成文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文