欢迎来到Introzo百科
Introzo百科
winform Textbox像百度一下实现下拉显示
-->
using System;
using System.Collections.Generic;
using System.ComponentModel;
using www.introzo.com;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; namespace _04TextBox
{
public partial class Form1 : Form
{
List Data = new List();
string Randomstr = "功夫撒黑胡椒hcbvf蜂窝qwertyuiopasdfghjklzxcvbnm法国的恢复到飞范德萨QWERTYUIOPASDFGHJKLZXCVBNM出现过热423贴①46546也有一头热刚恢复到贴3天赋如头3广泛的我让他";
Random rd = new Random(GetRandomSeed());
static int GetRandomSeed()
{
byte[] bytes = new byte[];
System.Security.Cryptography.RNGCryptoServiceProvider rng = new System.Security.Cryptography.RNGCryptoServiceProvider();
rng.GetBytes(bytes);
return BitConverter.ToInt32(bytes, );
} public Form1()
{
InitializeComponent(); //2000W数据,这里会有卡顿现象,这里修改为200W
for (int i = ; i < ; i++)
{
Data.Add(Randomstr.ToCharArray()[www.introzo.com(Randomstr.Length)].ToString()
+ Randomstr.ToCharArray()[www.introzo.com(Randomstr.Length)].ToString()
+ Randomstr.ToCharArray()[www.introzo.com(Randomstr.Length)].ToString()
+ Randomstr.ToCharArray()[www.introzo.com(Randomstr.Length)].ToString()
+ Randomstr.ToCharArray()[www.introzo.com(Randomstr.Length)].ToString());
}
//重点代码
this.textBox1.AutoCompleteCustomSource.Clear();
this.textBox1.AutoCompleteCustomSource.AddRange(Data.ToArray());
this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
} private void Form1_Load(object sender, EventArgs e)
{ } }
}
using System.Collections.Generic;
using System.ComponentModel;
using www.introzo.com;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; namespace _04TextBox
{
public partial class Form1 : Form
{
List
{
byte[] bytes = new byte[];
System.Security.Cryptography.RNGCryptoServiceProvider rng = new System.Security.Cryptography.RNGCryptoServiceProvider();
rng.GetBytes(bytes);
return BitConverter.ToInt32(bytes, );
} public Form1()
{
InitializeComponent(); //2000W数据,这里会有卡顿现象,这里修改为200W
for (int i = ; i < ; i++)
{
Data.Add(Randomstr.ToCharArray()[www.introzo.com(Randomstr.Length)].ToString()
+ Randomstr.ToCharArray()[www.introzo.com(Randomstr.Length)].ToString()
+ Randomstr.ToCharArray()[www.introzo.com(Randomstr.Length)].ToString()
+ Randomstr.ToCharArray()[www.introzo.com(Randomstr.Length)].ToString()
+ Randomstr.ToCharArray()[www.introzo.com(Randomstr.Length)].ToString());
}
//重点代码
this.textBox1.AutoCompleteCustomSource.Clear();
this.textBox1.AutoCompleteCustomSource.AddRange(Data.ToArray());
this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
} private void Form1_Load(object sender, EventArgs e)
{ } }
}
Form1 TextBox Source Code
最终实现效果如下:
-->
相关文章
- 10-05 戈多的场景树
- 10-05 戈多动画
- 10-05 在 Godot 中设计标题画面
- 10-05 信息搜索和可视化
- 10-05 设计流程与任务分析
- 10-05 颤动警报对话框
- 10-05 PostgreSQL远程连接配置管理/账号密码分配
- 10-05 Windows server 创建FTP 包括ft
- 10-05 Mongodb副本集加分片集群安全认证使用账号密码
- 10-05 浅谈ubuntu中执行.sh文件的几种方式的区别
- 10-05 Linux性能优化的实用思路和技巧(linux性能
- 10-05 如何轻松安装Linux系统显卡驱动(Linux安装
- 10-05 win10动态锁设置教程
- 10-05 win10关闭Win10右下角提示的教程
- 10-05 win10设置定时提醒闹钟方法
- 10-05 win10音频服务未运行 错误1068怎么办
- 10-05 win10哪里下载
- 10-05 Win10命令提示符打不开怎么办
- 10-05 实现发送模板消息功能的微信小程序示例【通过open
- 10-05 微信公众平台发送模板消息(Java接口开发)
- 最近发表