当前位置:网站首页>AutoComplete(自动完成)
AutoComplete(自动完成)
2022-07-22 02:19:00 【DotNeter-Hpf】
1.概述
- AutoComplete 控件与它相同的窗体上的任何编辑控件提供 AutoCompletion 服务
- 在数据输入期间提示您可能的匹配项
- 给 AutoComplete 赋数据源,将部分内容输入到编辑控件中,为其扩展为完整的字符串
2.入门
官方Demo注意点:
- 定义字符串合集,循环添加到DataTable,同时按照字符串合集的索引,将字符串对应的图片循环添加 ImageList
- 添加 ImageList 控件,后台代码将本地图片,循环添加进来
- 添加 AutoComplete 控件
- ImageList 属性绑定 上面添加的 ImageList 控件
- Columns 属性 添加两列
3.设置模式
模式 | 描述 | 截图 |
---|---|---|
AutoSuggest | 在下拉列表中显示可能匹配的列表,仅限首字母匹配,仅限第一列。 | ![]() |
AutoAppend | 自动为编辑器控件中的当前内容追加最合适的匹配项,不会出来下拉菜单,仅限首字母匹配,仅限第一列。 | ![]() |
Both | 为编辑器控件激活自动完成的 AutoAppend 和 AutoSuggest 模式,仅限首字母匹配,仅限第一列。 | ![]() |
Disabled | 禁用对编辑器控件的自动完成支持。 | ![]() |
MultiSuggest | 匹配多列首字母,MultiSuggest 模式是 AutoSuggest 的扩展模式。 | ![]() |
MultiSuggestExtend | 匹配多列,任意位置出现的字符,并加粗显示。 | ![]() |
通过代码设置模式
autoComplete1.SetAutoComplete(this.textBox1, Syncfusion.Windows.Forms.Tools.AutoCompleteModes.MultiSuggestExtended);
4.属性和方法
属性 | 描述 | 设计器添加 | 代码添加 |
---|---|---|---|
ShowColumnHeader | 指定匹配项的下拉列表是否显示其标题 | ![]() | this.autoComplete1.ShowColumnHeader = false; |
Columns.autoCompleteDataColumnInfo1.MatchingColumn | 文本匹配当前内容的列(输入的内容检索某一列,如果不生效添加this.autoComplete1.RefreshColumns();试试) | ![]() | this.autoCompleteDataColumnInfo1.MatchingColumn =true; this.autoComplete1.Columns[1].MatchingColumn = true; |
CaseSensitive | 指定是否忽略字符串比较的大小写,默认为true | ![]() | autoComplete1.CaseSensitive = true; |
AutoSortList | 是否需要在自动完成弹出窗口中的项目中执行排序,此属性的默认值为true | ![]() | autoComplete1.AutoSortList = true; |
ShowGripper | 右下脚是否显示抓取器(可拖动) | ![]() | this.autoComplete1.ShowGripper = true; |
EnableDuplicateValues | 获取或设置是否允许AutoComplete DataSource中的重复值,此属性的默认值为true | ![]() | autoComplete1.EnableDuplicateValues = true; |
AutoAddItem | 将item项添加到历史列表中。输入内容,按Enter后 | ![]() | autoComplete1.AutoAddItem = true; |
AllowListDelete | 将item项从历史列表中删除 | ![]() | autoComplete1.AllowListDelete = true; |
ResetHistory() | 删除 AutoComplete 组件保存的历史记录项 | autoComplete1.ResetHistory(); | |
MaxNumberofSuggestion | 设置在自动完成弹出窗口中显示的建议数量 | ![]() | autoComplete1.MaxNumberofSuggestion = 2; |
5.同志别走,加个QQ群啊
边栏推荐
- ADB common commands
- How to optimize this SQL?
- LeetCode练习1——二叉树剪枝
- RuntimeWarning: Glyph 25152 missing from current font. font.set_text(s, 0.0, flags=flags)
- AI chief architect 11 - "3d+ai" application and expansion in smart Sports
- Accelerate the construction of standard system and promote the high-quality development of data security industry
- 架构设计方案(持续更新ing)
- 92.(leaflet篇)leaflet态势标绘-进攻方向采集
- Succès de la construction du cluster expérimental tdengine
- Distributed link tracking skywalking Foundation
猜你喜欢
[information collection] write data from fofa API interface into txt and excel
How Linux queries Oracle error logs
DM8: query the data file size limit of Dameng database
产品Banner样式类型分析
MySQL Exercise one database Knowledge
产业数字化全面加速,智能云网2.0重新定义数字化转型
Write a maze game with R
92. (leaflet chapter) leaflet situation plotting - acquisition of attack direction
Tensorboard安装与使用
Two people line up to install locally & x360ce simulation handle Tutorial & xpadder handle simulation keyboard and mouse
随机推荐
Redis的conf配置
A simple inventory management system source code
Let security move | no matter what industry network architecture, these six tactics win the target
Architecture design scheme (continuously updating ing)
The difference between static variables and global variables
ADB common commands
Still asking what to use for interface testing? Universal JMeter creates a performance test data platform
JMeter notes 1 | introduction and architecture of JMeter
云原生Cloud Native
【07】函数调用:为什么会发生stack overflow?
Event handling of lvgl
OUU益生菌精耕胃肠健康,获奖天猫国际微生态创新大会
Aidl summary
还在问用什么来做接口测试?万能Jmeter打造性能测试数据平台
指数滑动平均法_百度百科
Equal protection compliance 2022 series | one center + triple protection, helping the construction of enterprise level protection to be more scientific
【医学分割】Medical Image Segmentation Using Deep Learning: A Survey
codeforces每日5题(均1500)-第二十二天
第3章——创建与维护MySQL数据表
LeetCode练习1——二叉树剪枝