自动完成文本框多个条目,以逗号分隔 [英] AutoComplete TextBox Multiple Entries Comma Separated

查看:87
本文介绍了自动完成文本框多个条目,以逗号分隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么方法可以使TextBox小部件自动完成,但是每次使用分隔符(例如,")时,都可以自动完成.

Is there any way of making a TextBox widget that autocompletes, but allows you to autocomplete each time you have a separator, for example a ",".

例如,我想在文本框中编写水果列表,例如:

Let's say I want to write a list of fruits in a textbox, for example:

苹果,梨"

...而我的有效条目列表是[苹果,梨,橙子,柑桔] 因此,每次我输入逗号都会重置自动完成功能,例如,"A"自动完成为"Apples",但是先输入逗号然后再键入"Pe"将自动完成为"Pears".

...and my list of valid entries is let's say [ Apples, Pears, Oranges, Clementines ] so each time I type a comma it resets the autocompletion, so that for example "A" was autocompleted to "Apples", but then typing a comma and then typing "Pe" will auto-complete to "Pears".

我知道有个大问题,但以防万一...

Big ask I know, but just in case...

推荐答案

我建议看一下自动填充文本框,您可以使用正则表达式用逗号分隔输入文本并将其分隔开,然后再次将控件填充到结果中.希望对您有帮助!

I suggest to take a look at this Autocomplete Textbox from there you use Regular Expressions to split the input text with commas and separate them and just populate again the control to whatever the result was. Hope it helps!

这篇关于自动完成文本框多个条目,以逗号分隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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