使用C#窗体从文本框中的Drop提示中选择数据 [英] Selecting Data from Drop Hint in Textbox using C# windows Form

查看:91
本文介绍了使用C#窗体从文本框中的Drop提示中选择数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想做的就是当任何字符输入到文本框中时相应的列表

从这个字符开始显示为下拉列表,所选值正在填充在文本框中。这仅适用于使用C#

Hi
I want to do like when any character is entered into the textbox the appropriate list
Starting with this character is shown like dropdown list the selected value is filling in the textbox. This is only for windows form using C#

推荐答案

的Windows窗体,你好,



你应该看看文本框的自动完成属性。

有:

Hello,

You should have a look at the "AutoComplete" properties of the text box.
There is:
AutoCompleteSource

让'你是你设置自动完成源(文件系统,最后一个URL,浏览器历史记录,自定义,...)

that let''s you set the source for autocompletion (File System, last URL, browser history, custom, ...)

AutoCompleteMode

让's'你选择向用户提出建议的方式

that let''s you select the way suggestions are proposed to the user

AutoCompleteCustomSource

让你设置建议列表(它是一个字符串)集合)当 AutoCompleteSource 设置为 CustomSource



我希望这些属性可以帮助您解决问题。

that let''s you set the list of suggestion (it is a string collection) when the AutoCompleteSource is set to CustomSource.

I hope those properties will help you solve your problem.


HI,



你可以轻松地做到这一点。



step-1:



创建一个文本框索引更改事件,然后绑定该索引中的下拉列表使用更改事件,例如运算符。



step-2:



在下拉列表的绑定中,将id绑定到value字段,将文本内容绑定到显示字段的文本。



谢谢


you can do this easily.

step-1:

create an textbox index changed event and then bind the dropdown in that indexchanged event using like operator.

step-2:

In the binding of the dropdown bind the id to the value field and the text content to the text showing field.

Thanks


这篇关于使用C#窗体从文本框中的Drop提示中选择数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆