逗号或者分号分隔的自动完成文本框 [英] Comma or semicolon-delimited AutoComplete TextBox

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

问题描述

我想有一个文本框支持自动完成,并允许用户键入多个单词用逗号或者分号分隔,提供适用于每个字的建议。我有一个标准的文本框

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:

  1. 键入AP
  2. 有它暗示苹果
  3. preSS逗号
  4. 有它的逗号后填写苹果,用光标
  5. 键入把
  6. 有它提示香蕉
  7. preSS逗号
  8. 有其附加的香蕉,造成苹果,香蕉,

我已经尝试使用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屋!

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