AutoComplete TextBox Multiple Entries Comma Separated

拈花ヽ惹草 提交于 2019-12-21 20:57:23

问题


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:

"Apples, 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...


回答1:


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!



来源:https://stackoverflow.com/questions/11708575/autocomplete-textbox-multiple-entries-comma-separated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!