逗号或者分号分隔的自动完成文本框 [英] Comma or semicolon-delimited AutoComplete TextBox
问题描述
我想有一个文本框
支持自动完成,并允许用户键入多个单词用逗号或者分号分隔,提供适用于每个字的建议。我有一个标准的文本框
与
I would like to have a TextBox
that supports AutoComplete and lets users type multiple words separated by a comma or semicolon, offering suggestions for each word. I have a standard TextBox
with
textBox.AutoCompleteCustomSource.AddRange(new[] { "apple", "banana", "carrot" });
textBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
textBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
不幸的是它只会显示的第一个字。任何类型之后,它停止提示。
Unfortunately it will only suggest for the first word. Anything typed after that and it stops suggesting.
我希望能够执行以下情形:
I want to be able to perform the following scenario:
- 键入AP
- 有它暗示苹果
- preSS逗号
- 有它的逗号后填写苹果,用光标
- 键入把
- 有它提示香蕉
- preSS逗号
- 有其附加的香蕉,造成苹果,香蕉,
我已经尝试使用Google的解决方案,但还没有多少运气。这似乎是对网络应用程序一个受欢迎的功能,但显然不适合的WinForms。有什么建议?
I've tried Googling for a solution, but haven't had much luck. This seems to be a popular feature for web apps, but apparently not for winforms. Any suggestions?
推荐答案
检查此文本框扩展<一href="http://pholpar.word$p$pss.com/2010/02/25/multivalue-autocomplete-winforms-textbox-for-tagging/" rel="nofollow">http://pholpar.word$p$pss.com/2010/02/25/multivalue-autocomplete-winforms-textbox-for-tagging/
这篇关于逗号或者分号分隔的自动完成文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!