自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(0)
  • 资源 (5)
  • 收藏
  • 关注

空空如也

vs shell2010.rar

解决sqlserver 2012无法打开,打开时提示 Cannot find one or more components.Please reinstall the application. 不需要重新安装数据库,只需安装此 文件即可。

2021-08-12

SqlServerBase64 加密解密.rar

SqlSerVer 进行Base64 加密解密,支持中文,数字,字母

2021-04-02

SqlServer 数据库 智能提示插件

SqlServer 智能提示插件 比如 在sqlserver2012新建查询窗口中输入ssf 然后按tab键,可生成 select * from

2020-10-20

最新版 .net reactor 5.0.0 破解版

最新版 .net reactor 5.0.0 破解版

2017-08-08

Winform智能提示效果

我们在使用WinForm中的TextBox的智能提示要使用到两个重要的TextBox属性, 一个是AutoCompleteMode,另一个是AutoCompleteSource。 AutoCompleteMode有四个值,分别是None,Append,Suggest,SuggestAppend。他们分别是:不给提示。最可能的匹配项自动追加到当前数据。产生由一个或多个建议完成字符串组成的下拉列表。最可能的匹配项自动追加到当前数据并产生由一个或多个建议完成字符串组成的下拉列表。 AutoCompleteSource属性允许您从一些系统源中进行选择,例如 FileSystem、HistoryList、RecentlyUsedList、AllUrl 和 CustomSource。如果选择 CustomSource,则必须向 AutoCompleteCustomSource属性提供一个字符串列表。 我们现在就开始 在VS中建一个新的项目,在From1中添加一个TextBox 并取名为TB_AutoComplete。再添加一个BackgroundWorker取名为bgWorker。 接下来的事都由代码完成。 public Form1() {     bgWorker.RunWorkerAsync();//打开异步操作,完成数据的读取     TB_AutoComplete.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //最可能的匹配项自动追加到当前数据并产生由一个或多个建议完成字符串组成的下拉列表     TB_AutoComplete.AutoCompleteSource = AutoCompleteSource.CustomSource; //设置智能提示的源为自定义源    } AutoCompleteStringCollection GetDataFromDB() { AutoCompleteStringCollection ac = new AutoCompleteStringCollection(); string constr = "server=.;initial catalog=AutoComplete;integrated security=true"; //数据库连接 SqlConnection con = new SqlConnection(constr); string sql = "select * from AutoComplete" ; //我这里使用一个叫AutoComplete的数据库,数据库里有两个字段 一个ID,一个AutoComplete。用于存放智能提示的内容    SqwlCommand cmd = new SqlCommand(sql, con); try { con.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { string text = reader.GetString(0); ac.Add(text); } con.Close(); } catch (Exception ee) { con.Close(); MessageBox.Show("程序出错了,错误原因是:\n" + ee.Message, "温馨提示"); } return ac; } 然后我们在设计页面中找到bgWorker 在他的DoWorkg事件中写入   private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { e.Result=GetDataFromDB(); } 在RunWorkerCompleted事件中写入 private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { TB_AutoComplete.AutoCompleteCustomSource = (AutoCompleteStringCollection)e.Result; } 这样我们的智能提示就完成 了 效果图看附件

2012-03-14

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除